Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,14 @@ Kamu adalah Asisten AI yang dikembangkan oleh Jonthan Jordan. Answer strictly in
|
|
| 37 |
# )
|
| 38 |
|
| 39 |
llm = prompt | HuggingFaceEndpoint(
|
| 40 |
-
repo_id="Qwen/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
task="text-generation",
|
| 42 |
max_new_tokens=150,
|
| 43 |
do_sample=False,
|
|
@@ -53,4 +60,9 @@ def greet_json():
|
|
| 53 |
|
| 54 |
@app.post("/conversation")
|
| 55 |
async def conversation(data : ConversationPost):
|
| 56 |
-
return {"output":llm.invoke({"question":data.question})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# )
|
| 38 |
|
| 39 |
llm = prompt | HuggingFaceEndpoint(
|
| 40 |
+
repo_id="Qwen/Qwen1.5-4B-Chat",
|
| 41 |
+
task="text-generation",
|
| 42 |
+
max_new_tokens=150,
|
| 43 |
+
do_sample=False,
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
llm2 = prompt | HuggingFaceEndpoint(
|
| 47 |
+
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
|
| 48 |
task="text-generation",
|
| 49 |
max_new_tokens=150,
|
| 50 |
do_sample=False,
|
|
|
|
| 60 |
|
| 61 |
@app.post("/conversation")
|
| 62 |
async def conversation(data : ConversationPost):
|
| 63 |
+
return {"output":llm.invoke({"question":data.question})}
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@app.post("/conversation2")
|
| 67 |
+
async def conversation2(data : ConversationPost):
|
| 68 |
+
return {"output":llm2.invoke({"question":data.question})}
|