kwabs22 commited on
Commit
279a4e6
·
1 Parent(s): b46f5ab

Test lambda to use hardcoded variables didnt work

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -64,11 +64,7 @@ def generate_response(user_message): #generate_response_token_by_token
64
  if process.returncode != 0:
65
  error_message = process.stderr.read()
66
  print(f"Error: {error_message}")
67
-
68
- def custom_generate_response(prompt_index, cust_user_message):
69
- cust_user_message = CustomPrompts[prompt_index] + '\n\n' + cust_user_message
70
- yield from generate_response(cust_user_message)
71
-
72
  def custom_generate_response0(cust_user_message):
73
  cust_user_message = CustomPrompts[0] + '\n\n' + cust_user_message + '\n\nClass Diagram:'
74
  yield from generate_response(cust_user_message)
@@ -104,7 +100,7 @@ with gr.Blocks() as iface:
104
  CustomButtonClassDiagram = gr.Button(CustomPrompts[0])
105
  CustomButtonPydotcode = gr.Button(CustomPrompts[1])
106
  CustomButtonHappyMovieScene = gr.Button(CustomPrompts[2])
107
- CustomButtonClassDiagram.click(lambda x: custom_generate_response(0, x), inputs=[CustomButtonInput], outputs=MainOutput) #custom_generate_response0, inputs=[CustomButtonInput], outputs=MainOutput)
108
  CustomButtonPydotcode.click(custom_generate_response1, inputs=[CustomButtonInput], outputs=MainOutput)
109
  CustomButtonHappyMovieScene.click(custom_generate_response2, inputs=[CustomButtonInput], outputs=MainOutput)
110
 
 
64
  if process.returncode != 0:
65
  error_message = process.stderr.read()
66
  print(f"Error: {error_message}")
67
+
 
 
 
 
68
  def custom_generate_response0(cust_user_message):
69
  cust_user_message = CustomPrompts[0] + '\n\n' + cust_user_message + '\n\nClass Diagram:'
70
  yield from generate_response(cust_user_message)
 
100
  CustomButtonClassDiagram = gr.Button(CustomPrompts[0])
101
  CustomButtonPydotcode = gr.Button(CustomPrompts[1])
102
  CustomButtonHappyMovieScene = gr.Button(CustomPrompts[2])
103
+ CustomButtonClassDiagram.click(custom_generate_response0, inputs=[CustomButtonInput], outputs=MainOutput)
104
  CustomButtonPydotcode.click(custom_generate_response1, inputs=[CustomButtonInput], outputs=MainOutput)
105
  CustomButtonHappyMovieScene.click(custom_generate_response2, inputs=[CustomButtonInput], outputs=MainOutput)
106