taesiri commited on
Commit
2adf285
β€’
1 Parent(s): e6b26e0
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +33 -10
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“–
4
  colorFrom: blue
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 3.34.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
4
  colorFrom: blue
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 3.50.2
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -96,7 +96,7 @@ class ContextualQA:
96
  def ask_question(self, question):
97
  leading_prompt = "Give the following paper:"
98
  trailing_prompt = "Now, answer the following question based on the content of the paper above. You can optionally use Markdown to format your answer or LaTeX typesetting to improve the presentation of your answer."
99
-
100
  prompt = f"{HUMAN_PROMPT} {leading_prompt} {self.context} {trailing_prompt} {HUMAN_PROMPT} {question} {AI_PROMPT}"
101
  response = self.client.completions.create(
102
  prompt=prompt,
@@ -176,21 +176,34 @@ def clear_context():
176
 
177
 
178
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
179
- gr.Markdown(
180
- "# Explore ArXiv Papers in Depth with `claude-2.0` - Ask Questions and Receive Detailed Answers Instantly"
181
- )
182
- gr.Markdown(
183
- "Dive into the world of academic papers with our dynamic app, powered by the cutting-edge `claude-2.0` model. This app allows you to ask detailed questions about any ArXiv paper and receive direct answers from the paper's content. Utilizing a context length of 100k tokens, it provides an efficient and comprehensive exploration of complex research studies, making knowledge acquisition simpler and more interactive. (This text is generated by GPT-4 )"
 
184
  )
185
-
186
  gr.HTML(
187
- """<center>All the inputs are being sent to Anthropic's Claude endpoints. Please refer to <a href="https://legal.anthropic.com/#privacy">this link</a> for privacy policy.</center>"""
 
 
 
 
188
  )
189
 
190
  gr.HTML(
191
- """<center><a href="https://huggingface.co/spaces/taesiri/ClaudeReadsArxiv?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your Anthropic API Key </center>"""
 
 
 
 
 
 
 
 
 
 
192
  )
193
-
194
 
195
  with gr.Column():
196
  with gr.Row():
@@ -207,6 +220,16 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
207
 
208
  btn_clear = gr.Button("Clear Chat")
209
 
 
 
 
 
 
 
 
 
 
 
210
  btn_load.click(load_context, inputs=[paper_id_input], outputs=[qa_model, chatbot])
211
 
212
  btn_answer.click(
 
96
  def ask_question(self, question):
97
  leading_prompt = "Give the following paper:"
98
  trailing_prompt = "Now, answer the following question based on the content of the paper above. You can optionally use Markdown to format your answer or LaTeX typesetting to improve the presentation of your answer."
99
+
100
  prompt = f"{HUMAN_PROMPT} {leading_prompt} {self.context} {trailing_prompt} {HUMAN_PROMPT} {question} {AI_PROMPT}"
101
  response = self.client.completions.create(
102
  prompt=prompt,
 
176
 
177
 
178
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
179
+ gr.HTML(
180
+ """
181
+ <h1 style='text-align: center; font-size: 24px;'>
182
+ Explore ArXiv Papers in Depth with <code>claude-2.0</code> - Ask Questions and Get Answers Instantly
183
+ </h1>
184
+ """
185
  )
 
186
  gr.HTML(
187
+ """
188
+ <p style='text-align: justify; font-size: 18px; margin: 10px;'>
189
+ Explore the depths of ArXiv papers with our interactive app, powered by the advanced <code>claude-2.0</code> model. Ask detailed questions and get immediate, context-rich answers from academic papers.
190
+ </p>
191
+ """
192
  )
193
 
194
  gr.HTML(
195
+ """
196
+ <center>
197
+ <a href="https://huggingface.co/spaces/taesiri/ClaudeReadsArxiv?duplicate=true">
198
+ <img src="https://bit.ly/3gLdBN6" alt="Duplicate Space" style="vertical-align: middle; max-width: 100px; margin-right: 10px;">
199
+ </a>
200
+ <span style="font-size: 14px; vertical-align: middle;">
201
+ Duplicate the Space with your Anthropic API Key &nbsp;|&nbsp;
202
+ Follow me on Twitter for more updates: <a href="https://twitter.com/taesiri" target="_blank">@taesiri</a>
203
+ </span>
204
+ </center>
205
+ """
206
  )
 
207
 
208
  with gr.Column():
209
  with gr.Row():
 
220
 
221
  btn_clear = gr.Button("Clear Chat")
222
 
223
+ gr.HTML(
224
+ """<center>All the inputs are being sent to Anthropic's Claude endpoints. Please refer to <a href="https://legal.anthropic.com/#privacy">this link</a> for privacy policy.</center>"""
225
+ )
226
+
227
+ gr.Markdown(
228
+ "## Acknowledgements\n"
229
+ "This project is made possible through the generous support of "
230
+ "[Anthropic](https://www.anthropic.com/), who provided free access to the `Claude-2.0` API."
231
+ )
232
+
233
  btn_load.click(load_context, inputs=[paper_id_input], outputs=[qa_model, chatbot])
234
 
235
  btn_answer.click(