Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -517,13 +517,26 @@ def perform_ai_lookup(q, vocal_summary=True, extended_refs=False,
|
|
517 |
api_name="/update_with_rag_md"
|
518 |
)[0]
|
519 |
|
520 |
-
r2 = client.predict(
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
)
|
526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
result = f"### 🔎 {q}\n\n{r2}\n\n{refs}"
|
528 |
md_file, audio_file = save_qa_with_audio(q, result)
|
529 |
st.subheader("📝 Main Response Audio")
|
|
|
517 |
api_name="/update_with_rag_md"
|
518 |
)[0]
|
519 |
|
520 |
+
#r2 = client.predict(
|
521 |
+
# q,
|
522 |
+
# "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
523 |
+
# True,
|
524 |
+
# api_name="/ask_llm"
|
525 |
+
#)
|
526 |
+
|
527 |
+
# --- 3) Claude API with arxiv list of papers to app.py
|
528 |
+
client = anthropic.Anthropic(api_key=anthropic_key)
|
529 |
+
user_input = q + '\n\n' + 'Use the paper list below to answer the question thinking through step by step how to create a streamlit app.py and requirements.txt for the solution that answers the questions with a working app to demonstrate.'+ '\n\n'
|
530 |
+
response = client.messages.create(
|
531 |
+
model="claude-3-sonnet-20240229",
|
532 |
+
max_tokens=1000,
|
533 |
+
messages=[
|
534 |
+
{"role": "user", "content": user_input}
|
535 |
+
])
|
536 |
+
r2 = response.content[0].text
|
537 |
+
st.write("Claude's reply 🧠:")
|
538 |
+
st.markdown(r2)
|
539 |
+
|
540 |
result = f"### 🔎 {q}\n\n{r2}\n\n{refs}"
|
541 |
md_file, audio_file = save_qa_with_audio(q, result)
|
542 |
st.subheader("📝 Main Response Audio")
|