Spaces:
Running
Running
Commit
·
8ae1bd1
1
Parent(s):
7232b90
adding chatbot with advanced options
Browse files
app.py
CHANGED
|
@@ -12,9 +12,9 @@ from langchain.prompts import PromptTemplate
|
|
| 12 |
DEVICE = 'cpu'
|
| 13 |
FILE_EXT = ['pdf','text','csv','word','wav']
|
| 14 |
DEFAULT_SYSTEM_PROMPT = "As a chatbot you are answering set of questions being requested ."
|
| 15 |
-
|
| 16 |
DEFAULT_TEMPERATURE = 0.1
|
| 17 |
-
DEFAULT_MAX_NEW_TOKENS =
|
| 18 |
MAX_INPUT_TOKEN_LENGTH = 4000
|
| 19 |
|
| 20 |
def loading_file():
|
|
@@ -155,22 +155,22 @@ with gr.Blocks(css=css) as demo:
|
|
| 155 |
|
| 156 |
with gr.Column():
|
| 157 |
with gr.Box():
|
| 158 |
-
file_extension = gr.Dropdown(FILE_EXT, label="File Extensions", info="Select
|
| 159 |
pdf_doc = gr.File(label="Upload File to start QA", file_types=FILE_EXT, type="file")
|
| 160 |
with gr.Accordion(label='Advanced options', open=False):
|
| 161 |
max_new_tokens = gr.Slider(
|
| 162 |
label='Max new tokens',
|
| 163 |
-
minimum=
|
| 164 |
-
maximum=
|
| 165 |
step=1,
|
| 166 |
value=DEFAULT_MAX_NEW_TOKENS,
|
| 167 |
)
|
| 168 |
temperature = gr.Slider(
|
| 169 |
label='Temperature',
|
| 170 |
-
minimum=
|
| 171 |
maximum=4.0,
|
| 172 |
step=0.1,
|
| 173 |
-
value=
|
| 174 |
)
|
| 175 |
with gr.Row():
|
| 176 |
langchain_status = gr.Textbox(label="Status", placeholder="", interactive = False)
|
|
|
|
| 12 |
DEVICE = 'cpu'
|
| 13 |
FILE_EXT = ['pdf','text','csv','word','wav']
|
| 14 |
DEFAULT_SYSTEM_PROMPT = "As a chatbot you are answering set of questions being requested ."
|
| 15 |
+
MAX_NEW_TOKENS = 4096
|
| 16 |
DEFAULT_TEMPERATURE = 0.1
|
| 17 |
+
DEFAULT_MAX_NEW_TOKENS = 2048
|
| 18 |
MAX_INPUT_TOKEN_LENGTH = 4000
|
| 19 |
|
| 20 |
def loading_file():
|
|
|
|
| 155 |
|
| 156 |
with gr.Column():
|
| 157 |
with gr.Box():
|
| 158 |
+
file_extension = gr.Dropdown(FILE_EXT, label="File Extensions", info="Select type of file to upload !")
|
| 159 |
pdf_doc = gr.File(label="Upload File to start QA", file_types=FILE_EXT, type="file")
|
| 160 |
with gr.Accordion(label='Advanced options', open=False):
|
| 161 |
max_new_tokens = gr.Slider(
|
| 162 |
label='Max new tokens',
|
| 163 |
+
minimum=2048,
|
| 164 |
+
maximum=MAX_NEW_TOKENS,
|
| 165 |
step=1,
|
| 166 |
value=DEFAULT_MAX_NEW_TOKENS,
|
| 167 |
)
|
| 168 |
temperature = gr.Slider(
|
| 169 |
label='Temperature',
|
| 170 |
+
minimum=0.1,
|
| 171 |
maximum=4.0,
|
| 172 |
step=0.1,
|
| 173 |
+
value=DEFAULT_TEMPERATURE,
|
| 174 |
)
|
| 175 |
with gr.Row():
|
| 176 |
langchain_status = gr.Textbox(label="Status", placeholder="", interactive = False)
|