phuongnv commited on
Commit
06558a8
1 Parent(s): 4424dec

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -4
main.py CHANGED
@@ -1,4 +1,4 @@
1
- from ctransformers import AutoModelForCausalLM, AutoTokenizer
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 = AutoModelForCausalLM.from_pretrained(model_name)
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 LLM FastAPI application!"}
 
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!"}