naourpally commited on
Commit
d48e96c
·
1 Parent(s): e47edb7

Remove comments

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ def get_text_response(prompt):
9
  "prompt": prompt,
10
  "stream": True
11
  }
12
- full_response = "" # Initialize an empty string to hold the full response
13
  with requests.post(api_url, json=data_payload, stream=True) as response:
14
  for line in response.iter_lines():
15
  if line:
@@ -19,8 +19,8 @@ def get_text_response(prompt):
19
  response_json = json.loads(json_line)
20
  text_response = response_json.get("response", "")
21
  done = response_json.get("done", False)
22
- full_response += text_response # Concatenate the new response
23
- yield full_response # Yield the full response so far
24
  if done:
25
  break
26
  except json.JSONDecodeError as e:
 
9
  "prompt": prompt,
10
  "stream": True
11
  }
12
+ full_response = ""
13
  with requests.post(api_url, json=data_payload, stream=True) as response:
14
  for line in response.iter_lines():
15
  if line:
 
19
  response_json = json.loads(json_line)
20
  text_response = response_json.get("response", "")
21
  done = response_json.get("done", False)
22
+ full_response += text_response
23
+ yield full_response
24
  if done:
25
  break
26
  except json.JSONDecodeError as e: