ccm commited on
Commit
b9f86a4
·
verified ·
1 Parent(s): e1832c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -67,8 +67,11 @@ publication_vectorstore = langchain_community.vectorstores.FAISS.load_local(
67
  )
68
 
69
  # Create the callable LLM
70
- llm = transformers.pipeline(
71
- task="text-generation", model="Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4", device="cuda"
 
 
 
72
  )
73
 
74
 
@@ -115,14 +118,15 @@ def reply(message: str, history: list[str]) -> str:
115
  str: The generated response from the language model.
116
  """
117
 
118
- return llm(
119
- preprocess(message),
120
- max_new_tokens=512,
121
- return_full_text=False,
122
- )[
123
- 0
124
- ]["generated_text"]
125
 
 
126
 
127
  # Example Queries for Interface
128
  EXAMPLE_QUERIES = [
 
67
  )
68
 
69
  # Create the callable LLM
70
+ # llm = transformers.pipeline(
71
+ # task="text-generation", model="Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4", device="cuda"
72
+ # )
73
+ llm = llama_cpp.Llama.from_pretrained(
74
+ repo_id="bartowski/Qwen2.5-7B-Instruct-GGUF", filename="Qwen2.5-7B-Instruct-Q4_K_M.gguf",
75
  )
76
 
77
 
 
118
  str: The generated response from the language model.
119
  """
120
 
121
+ # return llm(
122
+ # preprocess(message),
123
+ # max_new_tokens=512,
124
+ # return_full_text=False,
125
+ # )[
126
+ # 0
127
+ # ]["generated_text"]
128
 
129
+ return llm(preprocess(message))["choices"][0]["text"]
130
 
131
  # Example Queries for Interface
132
  EXAMPLE_QUERIES = [