Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModelForSeq2Se
|
|
| 5 |
import logging
|
| 6 |
import re
|
| 7 |
|
| 8 |
-
app = FastAPI()
|
| 9 |
|
| 10 |
# Enable CORS if needed
|
| 11 |
from fastapi.middleware.cors import CORSMiddleware
|
|
@@ -138,3 +138,7 @@ def generate_qa(request: GenerateQARequest):
|
|
| 138 |
@app.get("/")
|
| 139 |
def read_root():
|
| 140 |
return {"message": "Welcome to the Arabic Text Generation API!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
import logging
|
| 6 |
import re
|
| 7 |
|
| 8 |
+
app = FastAPI(root_path="/")
|
| 9 |
|
| 10 |
# Enable CORS if needed
|
| 11 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 138 |
@app.get("/")
|
| 139 |
def read_root():
|
| 140 |
return {"message": "Welcome to the Arabic Text Generation API!"}
|
| 141 |
+
if __name__ == "__main__":
|
| 142 |
+
import uvicorn
|
| 143 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 144 |
+
|