shoom013 commited on
Commit
750c80a
·
verified ·
1 Parent(s): 6b2f97e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,7 +25,7 @@ import os
25
  from io import StringIO
26
  from llama_index.core.memory import ChatMemoryBuffer
27
 
28
- memory = ChatMemoryBuffer.from_defaults(token_limit=1500)
29
  #
30
 
31
  last = 0
@@ -82,7 +82,7 @@ client = InferenceClient(LLM_NAME)
82
  Settings.llm = HuggingFaceInferenceAPI(model_name=LLM_NAME,
83
  # device_map="auto",
84
  # system_prompt = system_prompt,
85
- context_window=4092,
86
  max_new_tokens=3072,
87
  # stopping_ids=[50278, 50279, 50277, 1, 0],
88
  generate_kwargs={"temperature": temperature, "top_p":top_p, "repetition_penalty": repetition_penalty,
@@ -198,7 +198,7 @@ def rag(input_text, history, jezik, request: gr.Request): # , file):
198
  # response = query_engine.query(input_text)
199
  session_hash = request.session_hash
200
  url = "https://houseofplaying.com/ufo/list.php?limit=1" # An example public API
201
- response = requests.get(url)
202
  return response
203
  # gr.Textbox(label="Pitanje:", lines=6),
204
  # outputs=[gr.Textbox(label="Odgovor:", lines=6)],
 
25
  from io import StringIO
26
  from llama_index.core.memory import ChatMemoryBuffer
27
 
28
+ memory = ChatMemoryBuffer.from_defaults(token_limit=3072)
29
  #
30
 
31
  last = 0
 
82
  Settings.llm = HuggingFaceInferenceAPI(model_name=LLM_NAME,
83
  # device_map="auto",
84
  # system_prompt = system_prompt,
85
+ context_window=6144,
86
  max_new_tokens=3072,
87
  # stopping_ids=[50278, 50279, 50277, 1, 0],
88
  generate_kwargs={"temperature": temperature, "top_p":top_p, "repetition_penalty": repetition_penalty,
 
198
  # response = query_engine.query(input_text)
199
  session_hash = request.session_hash
200
  url = "https://houseofplaying.com/ufo/list.php?limit=1" # An example public API
201
+ api_response = requests.get(url)
202
  return response
203
  # gr.Textbox(label="Pitanje:", lines=6),
204
  # outputs=[gr.Textbox(label="Odgovor:", lines=6)],