Spaces:
Paused
Paused
fix
Browse files
app.py
CHANGED
@@ -2,11 +2,13 @@ from fastapi import FastAPI, HTTPException
|
|
2 |
from pydantic import BaseModel
|
3 |
import transformers
|
4 |
|
|
|
|
|
|
|
5 |
app = FastAPI()
|
6 |
|
7 |
-
|
8 |
-
model =
|
9 |
-
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
10 |
|
11 |
class ChatInput(BaseModel):
|
12 |
system_input: str
|
|
|
2 |
from pydantic import BaseModel
|
3 |
import transformers
|
4 |
|
5 |
+
# Load model directly
|
6 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
7 |
+
|
8 |
app = FastAPI()
|
9 |
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("Intel/neural-chat-7b-v3-1")
|
11 |
+
model = AutoModelForCausalLM.from_pretrained("Intel/neural-chat-7b-v3-1")
|
|
|
12 |
|
13 |
class ChatInput(BaseModel):
|
14 |
system_input: str
|