Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import urllib.request
|
| 2 |
import fitz
|
| 3 |
import re
|
|
@@ -5,8 +8,6 @@ import numpy as np
|
|
| 5 |
import tensorflow_hub as hub
|
| 6 |
import openai
|
| 7 |
import gradio as gr
|
| 8 |
-
import os
|
| 9 |
-
from sklearn.neighbors import NearestNeighbors
|
| 10 |
|
| 11 |
def download_pdf(url, output_path):
|
| 12 |
urllib.request.urlretrieve(url, output_path)
|
|
@@ -257,19 +258,21 @@ with gr.Blocks(css="""#chatbot { font-size: 14px; min-height: 1200; }""") as dem
|
|
| 257 |
inputs=[question],
|
| 258 |
label="PRE-DEFINED QUESTIONS: Click on a question to auto-fill the input box, then press Enter!",
|
| 259 |
)
|
| 260 |
-
model = gr.Radio(
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
btn = gr.Button(value='Submit')
|
| 270 |
|
| 271 |
-
btn.style(full_width=True)
|
| 272 |
-
|
| 273 |
with gr.Group():
|
| 274 |
chatbot = gr.Chatbot(placeholder="Chat History", label="Chat History", lines=50, elem_id="chatbot")
|
| 275 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TF logging
|
| 3 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = "-1" # Disable GPU
|
| 4 |
import urllib.request
|
| 5 |
import fitz
|
| 6 |
import re
|
|
|
|
| 8 |
import tensorflow_hub as hub
|
| 9 |
import openai
|
| 10 |
import gradio as gr
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def download_pdf(url, output_path):
|
| 13 |
urllib.request.urlretrieve(url, output_path)
|
|
|
|
| 258 |
inputs=[question],
|
| 259 |
label="PRE-DEFINED QUESTIONS: Click on a question to auto-fill the input box, then press Enter!",
|
| 260 |
)
|
| 261 |
+
model = gr.Radio(
|
| 262 |
+
choices=[
|
| 263 |
+
'gpt-3.5-turbo',
|
| 264 |
+
'gpt-3.5-turbo-16k',
|
| 265 |
+
'gpt-3.5-turbo-0613',
|
| 266 |
+
'gpt-3.5-turbo-16k-0613',
|
| 267 |
+
'text-davinci-003',
|
| 268 |
+
'gpt-4',
|
| 269 |
+
'gpt-4-32k'
|
| 270 |
+
],
|
| 271 |
+
label='Select Model',
|
| 272 |
+
value='gpt-3.5-turbo'
|
| 273 |
+
)
|
| 274 |
btn = gr.Button(value='Submit')
|
| 275 |
|
|
|
|
|
|
|
| 276 |
with gr.Group():
|
| 277 |
chatbot = gr.Chatbot(placeholder="Chat History", label="Chat History", lines=50, elem_id="chatbot")
|
| 278 |
|