Spaces:
Runtime error
Runtime error
shekharp77
commited on
Commit
•
89b0286
1
Parent(s):
e36b560
first commit
Browse files- Dockerfile +1 -1
- main.py +4 -0
Dockerfile
CHANGED
@@ -35,4 +35,4 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
35 |
RUN pip install fastapi uvicorn
|
36 |
|
37 |
|
38 |
-
CMD ["
|
|
|
35 |
RUN pip install fastapi uvicorn
|
36 |
|
37 |
|
38 |
+
CMD ["python", "main.py"]
|
main.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from transformers import AutoTokenizer, LlamaForCausalLM
|
2 |
from fastapi import FastAPI
|
3 |
from pydantic import BaseModel
|
@@ -23,3 +24,6 @@ async def stream(item: validation):
|
|
23 |
|
24 |
var = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
25 |
return var
|
|
|
|
|
|
|
|
1 |
+
import uvicorn
|
2 |
from transformers import AutoTokenizer, LlamaForCausalLM
|
3 |
from fastapi import FastAPI
|
4 |
from pydantic import BaseModel
|
|
|
24 |
|
25 |
var = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
26 |
return var
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|