eternalBlissard commited on
Commit
e2c2e67
·
verified ·
1 Parent(s): 8ea0288

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -78,16 +78,18 @@ def subtitle_it(subtitle_str):
78
  def respond(
79
  message,
80
  history: list[tuple[str, str]],
 
81
  system_message,
82
  max_tokens,
83
  temperature,
84
  top_p,
85
  ):
86
  global val
87
- if (val is None):
88
  subtitles = outputProducer(system_message)
89
  val = subtitle_it(subtitles)
90
  print(val)
 
91
  messages = [{"role": "system", "content": "Answer by using the transcript"+val}]
92
 
93
  for val in history:
@@ -119,6 +121,7 @@ demo = gr.ChatInterface(
119
  respond,
120
  additional_inputs=[
121
  gr.Video(value=None, label="System message"),
 
122
  gr.Slider(minimum=1, maximum=4098, value=1024, step=1, label="Max new tokens"),
123
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
124
  gr.Slider(
 
78
  def respond(
79
  message,
80
  history: list[tuple[str, str]],
81
+ reprocess,
82
  system_message,
83
  max_tokens,
84
  temperature,
85
  top_p,
86
  ):
87
  global val
88
+ if ((val is None) or reprocess):
89
  subtitles = outputProducer(system_message)
90
  val = subtitle_it(subtitles)
91
  print(val)
92
+ # reprocess-=1
93
  messages = [{"role": "system", "content": "Answer by using the transcript"+val}]
94
 
95
  for val in history:
 
121
  respond,
122
  additional_inputs=[
123
  gr.Video(value=None, label="System message"),
124
+ gr.Slider(minimum=0, maximum=1, value=1, step=1, label="Reprocess"),
125
  gr.Slider(minimum=1, maximum=4098, value=1024, step=1, label="Max new tokens"),
126
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
127
  gr.Slider(