Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -6,13 +6,13 @@ app = FastAPI()
|
|
| 6 |
|
| 7 |
pipe = pipeline("text-generation", model="MohamedSaeed-dev/gemma-2b-1500steps")
|
| 8 |
|
| 9 |
-
@app.post("/generate
|
| 10 |
async def generate_text(text:str):
|
| 11 |
messages = [
|
| 12 |
{"role": "user", "content": text},
|
| 13 |
]
|
| 14 |
output = pipe(messages)
|
| 15 |
-
return {"output": output
|
| 16 |
|
| 17 |
@app.get("/")
|
| 18 |
async def root():
|
|
|
|
| 6 |
|
| 7 |
pipe = pipeline("text-generation", model="MohamedSaeed-dev/gemma-2b-1500steps")
|
| 8 |
|
| 9 |
+
@app.post("/generate")
|
| 10 |
async def generate_text(text:str):
|
| 11 |
messages = [
|
| 12 |
{"role": "user", "content": text},
|
| 13 |
]
|
| 14 |
output = pipe(messages)
|
| 15 |
+
return {"output": output}
|
| 16 |
|
| 17 |
@app.get("/")
|
| 18 |
async def root():
|