Spaces:
Runtime error
Runtime error
Commit
·
f0f7aa3
1
Parent(s):
46b71da
Change model to Question2WrongAnswer
Browse files
app.py
CHANGED
|
@@ -8,7 +8,11 @@ app = FastAPI()
|
|
| 8 |
# This function will be able to generate text
|
| 9 |
# given an input.
|
| 10 |
pipe = pipeline("text2text-generation",
|
| 11 |
-
model="
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Define a function to handle the GET request at `/generate`
|
| 14 |
# The generate() function is defined as a FastAPI route that takes a
|
|
@@ -25,4 +29,5 @@ def generate(text: str):
|
|
| 25 |
output = pipe(text)
|
| 26 |
|
| 27 |
# Return the generated text in a JSON response
|
| 28 |
-
return {"output": output[0]["generated_text"]}
|
|
|
|
|
|
| 8 |
# This function will be able to generate text
|
| 9 |
# given an input.
|
| 10 |
pipe = pipeline("text2text-generation",
|
| 11 |
+
model="hirokibastos/Question2WrongAnswer")
|
| 12 |
+
|
| 13 |
+
@app.get("/")
|
| 14 |
+
def read_root():
|
| 15 |
+
return {"Hello": "World!"}
|
| 16 |
|
| 17 |
# Define a function to handle the GET request at `/generate`
|
| 18 |
# The generate() function is defined as a FastAPI route that takes a
|
|
|
|
| 29 |
output = pipe(text)
|
| 30 |
|
| 31 |
# Return the generated text in a JSON response
|
| 32 |
+
return {"output": output[0]["generated_text"]}
|
| 33 |
+
|