Spaces:
Paused
Paused
update
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 📖
|
|
4 |
colorFrom: blue
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
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.
|
180 |
-
"
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
184 |
)
|
185 |
-
|
186 |
gr.HTML(
|
187 |
-
"""
|
|
|
|
|
|
|
|
|
188 |
)
|
189 |
|
190 |
gr.HTML(
|
191 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
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(
|