Spaces:
Sleeping
Sleeping
Commit
·
692fe6e
1
Parent(s):
62aba98
switched to fastapi
Browse files
main.py
CHANGED
@@ -25,16 +25,16 @@ def hello():
|
|
25 |
return {"massage": "we are running!"}
|
26 |
|
27 |
|
28 |
-
@app.
|
29 |
-
def generate(prompt:
|
30 |
-
request_data = prompt.dict()
|
31 |
|
32 |
-
text = request_data["prompts"]
|
33 |
|
34 |
-
if
|
35 |
generated_recepie = generation_function(
|
36 |
-
|
37 |
else:
|
38 |
-
generated_recepie = generation_function(
|
39 |
|
40 |
return generated_recepie
|
|
|
25 |
return {"massage": "we are running!"}
|
26 |
|
27 |
|
28 |
+
@app.get("/generate/")
|
29 |
+
def generate(prompt: str, lang: str):
|
30 |
+
# request_data = prompt.dict()
|
31 |
|
32 |
+
# text = request_data["prompts"]
|
33 |
|
34 |
+
if lang:
|
35 |
generated_recepie = generation_function(
|
36 |
+
prompt, lang=lang)
|
37 |
else:
|
38 |
+
generated_recepie = generation_function(prompt)
|
39 |
|
40 |
return generated_recepie
|