Curranj commited on
Commit
6d9096d
1 Parent(s): e0c65e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -7,6 +7,8 @@ import gradio as gr
7
  from docx import Document
8
  from PyPDF2 import PdfFileReader
9
  import re
 
 
10
 
11
  # Set OpenAI API key from environment variable
12
  openai.api_key = os.environ["Secret"]
@@ -114,9 +116,8 @@ def predict(message, history, file_obj=None):
114
  yield partial_message
115
 
116
  # Modify the Gradio interface to include the file upload component
117
- gr.Interface(fn=predict,
118
- inputs=["text", "list", gr.inputs.File(label="Upload PDF or DOCX file (optional)")],
119
- outputs="chat",
120
- live=True).launch()
121
-
122
 
 
7
  from docx import Document
8
  from PyPDF2 import PdfFileReader
9
  import re
10
+ from gradio import Interface, components
11
+
12
 
13
  # Set OpenAI API key from environment variable
14
  openai.api_key = os.environ["Secret"]
 
116
  yield partial_message
117
 
118
  # Modify the Gradio interface to include the file upload component
119
+ Interface(fn=predict,
120
+ inputs=["text", "list", components.File(label="Upload PDF or DOCX file")],
121
+ outputs="textbox", # Using "textbox" as a replacement for "chat"
122
+ live=True).launch()
 
123