Update main.py
Browse files
main.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from
|
2 |
from fastapi import FastAPI, Form, HTTPException
|
3 |
from pydantic import BaseModel
|
4 |
import torch
|
@@ -8,8 +8,7 @@ app = FastAPI()
|
|
8 |
|
9 |
# Load the model and tokenizer
|
10 |
model_name = "model.gguf" # Replace with your model name
|
11 |
-
test_model =
|
12 |
-
test_tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
|
14 |
class RequestBody(BaseModel):
|
15 |
prompt: str
|
@@ -42,4 +41,4 @@ async def generate_text(request: RequestBody):
|
|
42 |
|
43 |
@app.get("/")
|
44 |
async def read_root():
|
45 |
-
return {"message": "Welcome to the
|
|
|
1 |
+
from llama_cpp import Llama
|
2 |
from fastapi import FastAPI, Form, HTTPException
|
3 |
from pydantic import BaseModel
|
4 |
import torch
|
|
|
8 |
|
9 |
# Load the model and tokenizer
|
10 |
model_name = "model.gguf" # Replace with your model name
|
11 |
+
test_model = Llama(model_name)
|
|
|
12 |
|
13 |
class RequestBody(BaseModel):
|
14 |
prompt: str
|
|
|
41 |
|
42 |
@app.get("/")
|
43 |
async def read_root():
|
44 |
+
return {"message": "Welcome to the RetroLLM app!"}
|