kwabs22 commited on
Commit
7d94414
·
1 Parent(s): 35ed179

Extra buttons

Browse files
Files changed (1) hide show
  1. app.py +35 -9
app.py CHANGED
@@ -3,6 +3,11 @@ import psutil
3
  import subprocess
4
  import time
5
 
 
 
 
 
 
6
  def generate_response(user_message): #generate_response_token_by_token
7
  cmd = [
8
  "/app/llama.cpp/main", # Path to the executable
@@ -89,6 +94,17 @@ CustomPrompts = [
89
  ("My problem to solve is", "- please make 10 sub problems have to solve from this:"),
90
  ]
91
 
 
 
 
 
 
 
 
 
 
 
 
92
  with gr.Blocks() as iface:
93
  gr.HTML("Stabilityai's demo - https://huggingface.co/spaces/stabilityai/stablelm-2-1_6b-zephyr")
94
  gr.Interface(
@@ -100,14 +116,24 @@ with gr.Blocks() as iface:
100
  flagging_dir="/usr/src/app/flagged",
101
  )
102
 
103
- with gr.Group():
104
- gr.HTML("Test for wrapping generator (Instead of buttons tabs and dropdowns?)")
105
- MainOutput = gr.TextArea(placeholder='Output will show here')
106
- CustomButtonInput = gr.TextArea(lines=1, placeholder='Prompt goes here')
107
-
108
- # Dynamically create buttons and assign actions
109
- for index, (prompt, _) in enumerate(CustomPrompts):
110
- button = gr.Button(prompt)
111
- button.click(custom_generate_response, inputs=[CustomButtonInput, gr.State(index)], outputs=MainOutput)
 
 
 
 
 
 
 
 
 
 
112
 
113
  iface.queue().launch(server_name="0.0.0.0", share=True)
 
3
  import subprocess
4
  import time
5
 
6
+ def generate_response_by_api():
7
+ FinalOutput = ""
8
+ #return FinalOutput
9
+ pass
10
+
11
  def generate_response(user_message): #generate_response_token_by_token
12
  cmd = [
13
  "/app/llama.cpp/main", # Path to the executable
 
94
  ("My problem to solve is", "- please make 10 sub problems have to solve from this:"),
95
  ]
96
 
97
+ BusinessPrompts = [
98
+ ("Write an outline for a business plan for " , "")
99
+ ("Write an outline for a Executive Summary for " , "Executive Summary:")
100
+ ("Write an outline for a Company Description for " , "Company Description:")
101
+ ("Write an outline for a Market Analysis for " , "Market Analysis:")
102
+ ("Write an outline for a Marketing and Sales Strategy for " , "Marketing and Sales Strategy:")
103
+ ("Write an outline for a Product Development for " , "Product Development:")
104
+ ("Write an outline for a Operations and Management for " , "Operations and Management:")
105
+ ("Write an outline for a Financial Projections for " , "Financial Projections:")
106
+ ]
107
+
108
  with gr.Blocks() as iface:
109
  gr.HTML("Stabilityai's demo - https://huggingface.co/spaces/stabilityai/stablelm-2-1_6b-zephyr")
110
  gr.Interface(
 
116
  flagging_dir="/usr/src/app/flagged",
117
  )
118
 
119
+ gr.HTML("Any standard way of thinking / Repetitive idea / rule of thumb / advice can be turned into a button (In a timeline?)")
120
+
121
+ with gr.Accordion("Random Ideas"):
122
+ with gr.Group():
123
+ gr.HTML("Test for wrapping generator (Instead of buttons tabs and dropdowns?)")
124
+ MainOutput = gr.TextArea(placeholder='Output will show here')
125
+ CustomButtonInput = gr.TextArea(lines=1, placeholder='Prompt goes here')
126
+
127
+ # Dynamically create buttons and assign actions
128
+ for index, (prompt, _) in enumerate(CustomPrompts):
129
+ button = gr.Button(prompt)
130
+ button.click(custom_generate_response, inputs=[CustomButtonInput, gr.State(index)], outputs=MainOutput)
131
+
132
+ with gr.Accordion("General Product based"):
133
+ with gr.Group():
134
+ # Dynamically create buttons and assign actions
135
+ for index, (prompt, _) in enumerate(CustomPrompts):
136
+ button = gr.Button(prompt)
137
+ button.click(custom_generate_response, inputs=[CustomButtonInput, gr.State(index)], outputs=MainOutput)
138
 
139
  iface.queue().launch(server_name="0.0.0.0", share=True)