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

Extra buttons

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -77,10 +77,25 @@ def custom_generate_response2(cust_user_message):
77
  cust_user_message = CustomPrompts[2] + '\n' + cust_user_message + '\n\nScene Details'
78
  yield from generate_response(cust_user_message)
79
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  CustomPrompts = [
81
  "Write a Class Diagram based on the following text:",
82
  "Write a Pydot code based on the following text:",
83
  "Describe what a standard happy scene in any movie would be planned in great detail, based on the following text:",
 
 
 
84
  ]
85
 
86
  with gr.Blocks() as iface:
@@ -88,7 +103,7 @@ with gr.Blocks() as iface:
88
  fn=generate_response,
89
  inputs=gr.Textbox(lines=2, placeholder="Type your message here..."),
90
  outputs="text",
91
- title="Stable LM 2 Zephyr (1.6b) LLama.cpp Interface Test",
92
  description="No Prompt template used yet (Essentially autocomplete). No Message History for now - Enter your message and get a response.",
93
  flagging_dir="/usr/src/app/flagged",
94
  )
@@ -97,11 +112,16 @@ with gr.Blocks() as iface:
97
  gr.HTML("Test for wrapping generator (Instead of buttons tabs and dropdowns?)")
98
  MainOutput = gr.TextArea(placeholder='Output will show here')
99
  CustomButtonInput = gr.TextArea(lines=1, placeholder='Prompt goes here')
 
 
 
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
 
107
  iface.queue().launch(server_name="0.0.0.0", share=True)
 
77
  cust_user_message = CustomPrompts[2] + '\n' + cust_user_message + '\n\nScene Details'
78
  yield from generate_response(cust_user_message)
79
 
80
+ def custom_generate_response3(cust_user_message):
81
+ cust_user_message = CustomPrompts[3] + '\n' + cust_user_message + '\n\nTeardown Details:'
82
+ yield from generate_response(cust_user_message)
83
+
84
+ def custom_generate_response4(cust_user_message):
85
+ cust_user_message = CustomPrompts[4] + '\n' + cust_user_message + '\n\nManufacturing Details:'
86
+ yield from generate_response(cust_user_message)
87
+
88
+ def custom_generate_response5(cust_user_message):
89
+ cust_user_message = CustomPrompts[5] + '\n' + cust_user_message + '\n\nConsiderations:'
90
+ yield from generate_response(cust_user_message)
91
+
92
  CustomPrompts = [
93
  "Write a Class Diagram based on the following text:",
94
  "Write a Pydot code based on the following text:",
95
  "Describe what a standard happy scene in any movie would be planned in great detail, based on the following text:",
96
+ "Explain a teardown of the product mentioned in the following text:",
97
+ "Explain the manufacturing of the product mentioned in the following text:",
98
+ "Explain the marketing considerations of the product mentioned in the following text:",
99
  ]
100
 
101
  with gr.Blocks() as iface:
 
103
  fn=generate_response,
104
  inputs=gr.Textbox(lines=2, placeholder="Type your message here..."),
105
  outputs="text",
106
+ title="Stable LM 2 Zephyr (1.6b) LLama.cpp Interface Test (Inconsistent Performance - 100 tokens in 50 secs or 800+ secs)",
107
  description="No Prompt template used yet (Essentially autocomplete). No Message History for now - Enter your message and get a response.",
108
  flagging_dir="/usr/src/app/flagged",
109
  )
 
112
  gr.HTML("Test for wrapping generator (Instead of buttons tabs and dropdowns?)")
113
  MainOutput = gr.TextArea(placeholder='Output will show here')
114
  CustomButtonInput = gr.TextArea(lines=1, placeholder='Prompt goes here')
115
+ CustomButtonClassDiagram = gr.Button(CustomPrompts[3])
116
+ CustomButtonClassDiagram = gr.Button(CustomPrompts[4])
117
+ CustomButtonClassDiagram = gr.Button(CustomPrompts[5])
118
  CustomButtonClassDiagram = gr.Button(CustomPrompts[0])
119
  CustomButtonPydotcode = gr.Button(CustomPrompts[1])
120
  CustomButtonHappyMovieScene = gr.Button(CustomPrompts[2])
121
  CustomButtonClassDiagram.click(custom_generate_response0, inputs=[CustomButtonInput], outputs=MainOutput)
122
  CustomButtonPydotcode.click(custom_generate_response1, inputs=[CustomButtonInput], outputs=MainOutput)
123
  CustomButtonHappyMovieScene.click(custom_generate_response2, inputs=[CustomButtonInput], outputs=MainOutput)
124
+ CustomButtonHappyMovieScene.click(custom_generate_response3, inputs=[CustomButtonInput], outputs=MainOutput)
125
+ CustomButtonHappyMovieScene.click(custom_generate_response4, inputs=[CustomButtonInput], outputs=MainOutput)
126
 
127
  iface.queue().launch(server_name="0.0.0.0", share=True)