Samarth991 commited on
Commit
e0dae7c
1 Parent(s): d9c78c0

adding video examples as Radio and linking to fn

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -142,27 +142,7 @@ with gr.Blocks(css=css) as demo:
142
  with gr.Column(elem_id="col-container"):
143
  gr.HTML(title)
144
 
145
- with gr.Column():
146
- with gr.Row():
147
- LLM_option = gr.Dropdown(['HuggingFace','OpenAI'],label='Select HuggingFace/OpenAI')
148
- API_key = gr.Textbox(label="Add API key", type="password",autofocus=True)
149
-
150
- with gr.Column():
151
- with gr.Accordion(label='Advanced options', open=False):
152
- max_new_tokens = gr.Slider(
153
- label='Max new tokens',
154
- minimum=2048,
155
- maximum=MAX_NEW_TOKENS,
156
- step=1,
157
- value=DEFAULT_MAX_NEW_TOKENS,
158
- )
159
- temperature = gr.Slider(label='Temperature',minimum=0.1,maximum=4.0,step=0.1,value=DEFAULT_TEMPERATURE,)
160
- char_length = gr.Slider(label='Max Character',
161
- minimum= DEFAULT_CHAR_LENGTH,
162
- maximum = 5*DEFAULT_CHAR_LENGTH,
163
- step = 500,value= 1500
164
- )
165
-
166
  with gr.Group():
167
  chatbot = gr.Chatbot(height=220)
168
  examples_set = gr.Radio(label="Examples of some You tube Videos",choices=EXAMPLES)
@@ -172,6 +152,11 @@ with gr.Blocks(css=css) as demo:
172
  with gr.Row():
173
  submit_btn = gr.Button(value="Send message", variant="primary", scale = 1)
174
  clean_chat_btn = gr.Button("Delete Chat")
 
 
 
 
 
175
 
176
  with gr.Column():
177
  with gr.Box():
@@ -179,6 +164,22 @@ with gr.Blocks(css=css) as demo:
179
  with gr.Row():
180
  load_youtube_bt = gr.Button("Process Youtube Link",).style(full_width = False)
181
  langchain_status = gr.Textbox(label="Status", placeholder="", interactive = False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  examples_set.change(fn=youtube_chat, inputs=[examples_set,API_key,LLM_option,temperature,max_new_tokens,char_length], outputs=[langchain_status])
184
  youtube_link = examples_set
 
142
  with gr.Column(elem_id="col-container"):
143
  gr.HTML(title)
144
 
145
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  with gr.Group():
147
  chatbot = gr.Chatbot(height=220)
148
  examples_set = gr.Radio(label="Examples of some You tube Videos",choices=EXAMPLES)
 
152
  with gr.Row():
153
  submit_btn = gr.Button(value="Send message", variant="primary", scale = 1)
154
  clean_chat_btn = gr.Button("Delete Chat")
155
+
156
+ with gr.Column():
157
+ with gr.Row():
158
+ LLM_option = gr.Dropdown(['HuggingFace','OpenAI'],label='Select HuggingFace/OpenAI')
159
+ API_key = gr.Textbox(label="Add API key", type="password",autofocus=True)
160
 
161
  with gr.Column():
162
  with gr.Box():
 
164
  with gr.Row():
165
  load_youtube_bt = gr.Button("Process Youtube Link",).style(full_width = False)
166
  langchain_status = gr.Textbox(label="Status", placeholder="", interactive = False)
167
+
168
+ with gr.Column():
169
+ with gr.Accordion(label='Advanced options', open=False):
170
+ max_new_tokens = gr.Slider(
171
+ label='Max new tokens',
172
+ minimum=2048,
173
+ maximum=MAX_NEW_TOKENS,
174
+ step=1,
175
+ value=DEFAULT_MAX_NEW_TOKENS,
176
+ )
177
+ temperature = gr.Slider(label='Temperature',minimum=0.1,maximum=4.0,step=0.1,value=DEFAULT_TEMPERATURE,)
178
+ char_length = gr.Slider(label='Max Character',
179
+ minimum= DEFAULT_CHAR_LENGTH,
180
+ maximum = 5*DEFAULT_CHAR_LENGTH,
181
+ step = 500,value= 1500
182
+ )
183
 
184
  examples_set.change(fn=youtube_chat, inputs=[examples_set,API_key,LLM_option,temperature,max_new_tokens,char_length], outputs=[langchain_status])
185
  youtube_link = examples_set