Shreekant Kalwar (Nokia)
commited on
Commit
·
149a73b
1
Parent(s):
55a61ee
runtime.txt add
Browse files
app.py
CHANGED
|
@@ -17,6 +17,8 @@ def root():
|
|
| 17 |
model_name = "deepseek-ai/deepseek-coder-1.3b-instruct"
|
| 18 |
|
| 19 |
print("Loading model... this may take a minute ⏳")
|
|
|
|
|
|
|
| 20 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 21 |
model = AutoModelForCausalLM.from_pretrained(
|
| 22 |
model_name,
|
|
@@ -24,7 +26,7 @@ def root():
|
|
| 24 |
device_map="auto"
|
| 25 |
)
|
| 26 |
print("Model loaded ✅")
|
| 27 |
-
|
| 28 |
return {"status": "ok"}
|
| 29 |
|
| 30 |
@app.post("/chat")
|
|
|
|
| 17 |
model_name = "deepseek-ai/deepseek-coder-1.3b-instruct"
|
| 18 |
|
| 19 |
print("Loading model... this may take a minute ⏳")
|
| 20 |
+
global tokenizer
|
| 21 |
+
global model
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 23 |
model = AutoModelForCausalLM.from_pretrained(
|
| 24 |
model_name,
|
|
|
|
| 26 |
device_map="auto"
|
| 27 |
)
|
| 28 |
print("Model loaded ✅")
|
| 29 |
+
|
| 30 |
return {"status": "ok"}
|
| 31 |
|
| 32 |
@app.post("/chat")
|