Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 =
|
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 |
-
|
82 |
-
|
83 |
-
|
84 |
-
repetition_penalty=
|
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.
|