Spaces:
Sleeping
Sleeping
Commit
·
1a96a44
1
Parent(s):
b2c1928
updated model.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from fastapi import FastAPI, HTTPException
|
| 2 |
from model import generate_code
|
| 3 |
|
|
@@ -17,3 +18,6 @@ def generate(prompt: str, max_tokens: int = 256):
|
|
| 17 |
return {"generated_code": code}
|
| 18 |
except Exception as e:
|
| 19 |
raise HTTPException(status_code=500, detail=f"Internal Server Error: {str(e)}")
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import uvicorn
|
| 2 |
from fastapi import FastAPI, HTTPException
|
| 3 |
from model import generate_code
|
| 4 |
|
|
|
|
| 18 |
return {"generated_code": code}
|
| 19 |
except Exception as e:
|
| 20 |
raise HTTPException(status_code=500, detail=f"Internal Server Error: {str(e)}")
|
| 21 |
+
|
| 22 |
+
if __name__ == "__main__":
|
| 23 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|