Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,8 @@ import warnings
|
|
| 6 |
import pandas as pd
|
| 7 |
from huggingface_hub import login
|
| 8 |
import re
|
|
|
|
|
|
|
| 9 |
import json
|
| 10 |
from groq import Groq
|
| 11 |
|
|
@@ -30,6 +32,15 @@ class BasicAgent:
|
|
| 30 |
If you are asked for a comma separated list, apply the above rules depending of whether the element
|
| 31 |
to be put in the list is a number or a string."""
|
| 32 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
def format_final_answer(self, answer: str) -> str:
|
| 35 |
cleaned = " ".join(answer.split())
|
|
|
|
| 6 |
import pandas as pd
|
| 7 |
from huggingface_hub import login
|
| 8 |
import re
|
| 9 |
+
from fastapi import FastAPI
|
| 10 |
+
from fastapi.responses import JSONResponse
|
| 11 |
import json
|
| 12 |
from groq import Groq
|
| 13 |
|
|
|
|
| 32 |
If you are asked for a comma separated list, apply the above rules depending of whether the element
|
| 33 |
to be put in the list is a number or a string."""
|
| 34 |
)
|
| 35 |
+
|
| 36 |
+
app = FastAPI()
|
| 37 |
+
|
| 38 |
+
@app.get("/questions")
|
| 39 |
+
def get_questions():
|
| 40 |
+
with open("questions.json", "r") as f:
|
| 41 |
+
data = json.load(f)
|
| 42 |
+
return JSONResponse(content=data)
|
| 43 |
+
|
| 44 |
|
| 45 |
def format_final_answer(self, answer: str) -> str:
|
| 46 |
cleaned = " ".join(answer.split())
|