Spaces:
Sleeping
Sleeping
Delete DeployingModel
Browse files
DeployingModel/Dockerfile
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
FROM python:3.9
|
2 |
-
|
3 |
-
WORKDIR /code
|
4 |
-
|
5 |
-
COPY ./requirements.txt /code/requirements.txt
|
6 |
-
|
7 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
-
|
9 |
-
COPY ./zephyr-7b-beta.Q4_K_S.gguf /code/zephyr-7b-beta.Q4_K_S.gguf
|
10 |
-
COPY ./main.py /code/main.py
|
11 |
-
|
12 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeployingModel/main.py
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
from ctransformers import AutoModelForCausalLM
|
2 |
-
from fastapi import FastAPI
|
3 |
-
from pydantic import BaseModel
|
4 |
-
|
5 |
-
|
6 |
-
llm = AutoModelForCausalLM.from_pretrained("zephyr-7b-beta.Q4_K_S.gguf",
|
7 |
-
model_type='mistral',
|
8 |
-
max_new_tokens = 1096,
|
9 |
-
threads = 3,
|
10 |
-
)
|
11 |
-
|
12 |
-
#Pydantic object
|
13 |
-
class validation(BaseModel):
|
14 |
-
prompt: str
|
15 |
-
#Fast API
|
16 |
-
app = FastAPI()
|
17 |
-
|
18 |
-
@app.post("/llm_on_cpu")
|
19 |
-
async def stream(item: validation):
|
20 |
-
system_prompt = 'Below is an instruction that describes a task. Write a response that appropriately completes the request.'
|
21 |
-
E_INST = "</s>"
|
22 |
-
user, assistant = "<|user|>", "<|assistant|>"
|
23 |
-
prompt = f"{system_prompt}{E_INST}\n{user}\n{item.prompt}{E_INST}\n{assistant}\n"
|
24 |
-
return llm(prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeployingModel/requirements.txt
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
python-multipart
|
2 |
-
fastapi
|
3 |
-
pydantic
|
4 |
-
uvicorn
|
5 |
-
requests
|
6 |
-
python-dotenv
|
7 |
-
ctransformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeployingModel/zephyr-7b-beta.Q4_K_S.gguf
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:cafa0b85b2efc15ca33023f3b87f8d0c44ddcace16b3fb608280e0eb8f425cb1
|
3 |
-
size 4140373696
|
|
|
|
|
|
|
|