Omnibus commited on
Commit
13dc8ee
·
1 Parent(s): fe75326

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -151,6 +151,15 @@ def compress_data(c, history):
151
 
152
 
153
  def summarize(inp,file=None):
 
 
 
 
 
 
 
 
 
154
  print(inp)
155
  out = str(inp)
156
  rl = len(out)
@@ -177,13 +186,16 @@ examples =[
177
  "return the top 10 models that I can use to identify objects in images",
178
  "which models have the most likes from each category?"
179
  ]
180
-
 
 
181
 
182
  app = gr.ChatInterface(
183
  fn=summarize,
184
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
185
- title="<center>Mixtral 8x7B TLDR",
186
  description="<center>Summarize Lengthy data with<br>Mixtral 8x7B",
 
187
  examples=examples,
188
  concurrency_limit=20,
189
  )
 
151
 
152
 
153
  def summarize(inp,file=None):
154
+ if file !=None:
155
+ try:
156
+ with open(file,"r") as f:
157
+ zz=f.readlines()
158
+ f.close
159
+ print (zz)
160
+ except Exception as e:
161
+ print e
162
+
163
  print(inp)
164
  out = str(inp)
165
  rl = len(out)
 
186
  "return the top 10 models that I can use to identify objects in images",
187
  "which models have the most likes from each category?"
188
  ]
189
+ additional_inputs=[
190
+ gr.File(),
191
+ ]
192
 
193
  app = gr.ChatInterface(
194
  fn=summarize,
195
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
196
+ title="<center>Mixtral 8x7B TLDR</center>",
197
  description="<center>Summarize Lengthy data with<br>Mixtral 8x7B",
198
+ additional_inputs,
199
  examples=examples,
200
  concurrency_limit=20,
201
  )