Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,9 @@ app = FastAPI()
|
|
| 11 |
def greet_json():
|
| 12 |
return {"Hello": "World!"}
|
| 13 |
|
| 14 |
-
@app.get("/message
|
| 15 |
-
def message(
|
| 16 |
-
inputs = tokenizer(
|
| 17 |
output = model.generate(
|
| 18 |
input_ids=inputs["input_ids"],
|
| 19 |
attention_mask=inputs["attention_mask"],
|
|
|
|
| 11 |
def greet_json():
|
| 12 |
return {"Hello": "World!"}
|
| 13 |
|
| 14 |
+
@app.get("/message)
|
| 15 |
+
async def message(input: str):
|
| 16 |
+
inputs = tokenizer(input, return_tensors="pt", padding=True, truncation=True)
|
| 17 |
output = model.generate(
|
| 18 |
input_ids=inputs["input_ids"],
|
| 19 |
attention_mask=inputs["attention_mask"],
|