GaboDataScientist commited on
Commit
4cc4918
·
verified ·
1 Parent(s): 4c9d30f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -28,15 +28,8 @@ def CustomChatGPT(Ask):
28
  repeat_penalty=1.2, top_k=150,
29
  echo=True)
30
 
31
- reply=response["choices"][0]["text"]
32
- # Split the response by lines
33
- #response_lines = reply.split("\n")
34
-
35
- # Find the index of the ASSISTANT line
36
- #assistant_index = response_lines.index("ASSISTANT:")
37
-
38
- # Extract the assistant response by joining the lines after the ASSISTANT line
39
- #assistant_response = "\n".join(response_lines[assistant_index + 1:])
40
  return reply
41
 
42
  gui=gr.Interface(fn=CustomChatGPT, inputs="text", outputs="text", examples=["Who is the greatest basketball player in NBA history","What is the winning record in a season?"] , title="Ask the AI coach", description="Ask the AI coach all you want about NBA Teams and Players:")
 
28
  repeat_penalty=1.2, top_k=150,
29
  echo=True)
30
 
31
+ #reply=response["choices"][0]["text"]
32
+ reply = response["choices"][0]["text"].split("ASSISTANT:")[1].strip()
 
 
 
 
 
 
 
33
  return reply
34
 
35
  gui=gr.Interface(fn=CustomChatGPT, inputs="text", outputs="text", examples=["Who is the greatest basketball player in NBA history","What is the winning record in a season?"] , title="Ask the AI coach", description="Ask the AI coach all you want about NBA Teams and Players:")