cnmoro commited on
Commit
c3c1ac5
·
verified ·
1 Parent(s): d5b39b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -50,7 +50,7 @@ def index_and_search(query, text):
50
 
51
  # Retrieval
52
  start = time.time()
53
- search_results = vector_db.find_most_similar(query_embedding, k = 7)
54
  retrieval_time = time.time() - start
55
  return '\n'.join([s['sentence'] for s in search_results[2]]), embedding_time, retrieval_time
56
 
@@ -78,10 +78,10 @@ def ask_open_llm(prompt):
78
  model_inputs,
79
  streamer=streamer,
80
  max_new_tokens=2048 - count_tokens(prompt),
81
- top_p=0.2,
82
- top_k=20,
83
- temperature=0.4,
84
- repetition_penalty=1.1
85
  )
86
  t = Thread(target=llm.generate, kwargs=generate_kwargs)
87
  t.start() # Starting the generation in a separate thread.
 
50
 
51
  # Retrieval
52
  start = time.time()
53
+ search_results = vector_db.find_most_similar(query_embedding, k = 5)
54
  retrieval_time = time.time() - start
55
  return '\n'.join([s['sentence'] for s in search_results[2]]), embedding_time, retrieval_time
56
 
 
78
  model_inputs,
79
  streamer=streamer,
80
  max_new_tokens=2048 - count_tokens(prompt),
81
+ do_sample=True,
82
+ temperature=0.7,
83
+ top_p=0.9,
84
+ repetition_penalty=2.5
85
  )
86
  t = Thread(target=llm.generate, kwargs=generate_kwargs)
87
  t.start() # Starting the generation in a separate thread.