Spaces:
Paused
Paused
Daniel Marques
commited on
Commit
•
1016fdb
1
Parent(s):
8f1d4f2
fix: delete system message
Browse files
main.py
CHANGED
@@ -68,26 +68,18 @@ QA = RetrievalQA.from_chain_type(
|
|
68 |
)
|
69 |
|
70 |
|
71 |
-
QA_CHAIN_PROMPT = PromptTemplate.from_template(template)
|
72 |
-
|
73 |
class Predict(BaseModel):
|
74 |
prompt: str
|
75 |
|
76 |
app = FastAPI(title="homepage-app")
|
77 |
api_app = FastAPI(title="api app")
|
78 |
|
79 |
-
app.mount("/api", api_app)
|
80 |
app.mount("/", StaticFiles(directory="static",html = True), name="static")
|
81 |
|
82 |
-
|
83 |
-
# @app.get("/")
|
84 |
-
# def read_root():
|
85 |
-
# return {"Hello": "World"}
|
86 |
-
|
87 |
@api_app.post('/predict')
|
88 |
async def predict(data: Predict):
|
89 |
-
|
90 |
-
user_prompt = system_message + " " + input_prompt
|
91 |
if user_prompt:
|
92 |
# print(f'User Prompt: {user_prompt}')
|
93 |
# Get the answer from the chain
|
|
|
68 |
)
|
69 |
|
70 |
|
|
|
|
|
71 |
class Predict(BaseModel):
|
72 |
prompt: str
|
73 |
|
74 |
app = FastAPI(title="homepage-app")
|
75 |
api_app = FastAPI(title="api app")
|
76 |
|
77 |
+
app.mount("/api", api_app, name="api")
|
78 |
app.mount("/", StaticFiles(directory="static",html = True), name="static")
|
79 |
|
|
|
|
|
|
|
|
|
|
|
80 |
@api_app.post('/predict')
|
81 |
async def predict(data: Predict):
|
82 |
+
user_prompt = data.prompt
|
|
|
83 |
if user_prompt:
|
84 |
# print(f'User Prompt: {user_prompt}')
|
85 |
# Get the answer from the chain
|