Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ from fastapi import FastAPI
|
|
2 |
import uvicorn
|
3 |
from transformers import AutoTokenizer, AutoModel
|
4 |
|
5 |
-
model_name = "TheBloke/
|
6 |
|
7 |
model = AutoModel.from_pretrained(model_name)
|
8 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
@@ -15,7 +15,8 @@ def greet_json():
|
|
15 |
|
16 |
@app.get("/message")
|
17 |
async def message(input: str):
|
18 |
-
|
|
|
19 |
|
20 |
output = model.generate(
|
21 |
input_ids=inputs["input_ids"],
|
|
|
2 |
import uvicorn
|
3 |
from transformers import AutoTokenizer, AutoModel
|
4 |
|
5 |
+
model_name = "TheBloke/Guanaco-7B-Uncensored-AWQ"
|
6 |
|
7 |
model = AutoModel.from_pretrained(model_name)
|
8 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
15 |
|
16 |
@app.get("/message")
|
17 |
async def message(input: str):
|
18 |
+
prompt = "### Human: " + input + "\n### Assistant:"
|
19 |
+
inputs = tokenizer(prompt, return_tensors="pt", padding=True, truncation=True)
|
20 |
|
21 |
output = model.generate(
|
22 |
input_ids=inputs["input_ids"],
|