mtyrrell commited on
Commit
1d92e08
·
verified ·
1 Parent(s): af6bdcc

Update appStore/rag.py

Browse files
Files changed (1) hide show
  1. appStore/rag.py +2 -1
appStore/rag.py CHANGED
@@ -10,7 +10,6 @@ from huggingface_hub import InferenceClient
10
 
11
  # Get openai API key
12
  hf_token = os.environ["HF_API_KEY"]
13
-
14
  # define a special function for putting the prompt together (as we can't use haystack)
15
  def get_prompt(context, label):
16
  base_prompt="Summarize the following context efficiently in bullet points, the less the better - but keep concrete goals. \
@@ -62,6 +61,8 @@ def run_query(context, label):
62
  # res_box.success(result) # output to response text box
63
  res_box.success(result)
64
 
 
 
65
 
66
 
67
 
 
10
 
11
  # Get openai API key
12
  hf_token = os.environ["HF_API_KEY"]
 
13
  # define a special function for putting the prompt together (as we can't use haystack)
14
  def get_prompt(context, label):
15
  base_prompt="Summarize the following context efficiently in bullet points, the less the better - but keep concrete goals. \
 
61
  # res_box.success(result) # output to response text box
62
  res_box.success(result)
63
 
64
+ if chunk.choices[0].finish_reason != None:
65
+ break
66
 
67
 
68