Sean-Case
commited on
Commit
•
c2ff47a
1
Parent(s):
7339026
Put sources behind accordion, minor change to model params. Gitignore update
Browse files- .gitignore +3 -1
- app.py +5 -3
- chatfuncs/chatfuncs.py +2 -3
.gitignore
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
*.pdf
|
4 |
*.spec
|
5 |
*.toc
|
|
|
6 |
bootstrapper.py
|
7 |
build/*
|
8 |
-
dist/*
|
|
|
|
3 |
*.pdf
|
4 |
*.spec
|
5 |
*.toc
|
6 |
+
*.csv
|
7 |
bootstrapper.py
|
8 |
build/*
|
9 |
+
dist/*
|
10 |
+
Q tests/*
|
app.py
CHANGED
@@ -95,11 +95,13 @@ def load_model(model_type, gpu_layers, gpu_config=None, cpu_config=None, torch_d
|
|
95 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Orca-Mini-3B-gguf', model_type='llama', model_file='q5_0-orca-mini-3b.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
96 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Wizard-Orca-3B-gguf', model_type='llama', model_file='q4_1-wizard-orca-3b.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
97 |
model = AutoModelForCausalLM.from_pretrained('TheBloke/Mistral-7B-OpenOrca-GGUF', model_type='mistral', model_file='mistral-7b-openorca.Q4_K_M.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
|
|
98 |
|
99 |
except:
|
100 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Orca-Mini-3B-gguf', model_type='llama', model_file='q5_0-orca-mini-3b.gguf', **vars(cpu_config)) #**asdict(CtransRunConfig_gpu())
|
101 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Wizard-Orca-3B-gguf', model_type='llama', model_file='q4_1-wizard-orca-3b.gguf', **vars(cpu_config)) # **asdict(CtransRunConfig_cpu())
|
102 |
model = AutoModelForCausalLM.from_pretrained('TheBloke/Mistral-7B-OpenOrca-GGUF', model_type='mistral', model_file='mistral-7b-openorca.Q4_K_M.gguf', **vars(cpu_config)) # **asdict(CtransRunConfig_cpu())
|
|
|
103 |
|
104 |
tokenizer = []
|
105 |
|
@@ -192,12 +194,12 @@ with block:
|
|
192 |
with gr.Row():
|
193 |
chat_height = 500
|
194 |
chatbot = gr.Chatbot(height=chat_height, avatar_images=('user.jfif', 'bot.jpg'),bubble_full_width = False, scale = 1)
|
195 |
-
|
196 |
-
|
197 |
|
198 |
with gr.Row():
|
199 |
message = gr.Textbox(
|
200 |
-
label="Enter your question here
|
201 |
lines=1,
|
202 |
)
|
203 |
with gr.Row():
|
|
|
95 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Orca-Mini-3B-gguf', model_type='llama', model_file='q5_0-orca-mini-3b.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
96 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Wizard-Orca-3B-gguf', model_type='llama', model_file='q4_1-wizard-orca-3b.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
97 |
model = AutoModelForCausalLM.from_pretrained('TheBloke/Mistral-7B-OpenOrca-GGUF', model_type='mistral', model_file='mistral-7b-openorca.Q4_K_M.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
98 |
+
#model = AutoModelForCausalLM.from_pretrained('TheBloke/MistralLite-7B-GGUF', model_type='mistral', model_file='mistrallite.Q4_K_M.gguf', **vars(gpu_config)) # **asdict(CtransRunConfig_cpu())
|
99 |
|
100 |
except:
|
101 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Orca-Mini-3B-gguf', model_type='llama', model_file='q5_0-orca-mini-3b.gguf', **vars(cpu_config)) #**asdict(CtransRunConfig_gpu())
|
102 |
#model = AutoModelForCausalLM.from_pretrained('Aryanne/Wizard-Orca-3B-gguf', model_type='llama', model_file='q4_1-wizard-orca-3b.gguf', **vars(cpu_config)) # **asdict(CtransRunConfig_cpu())
|
103 |
model = AutoModelForCausalLM.from_pretrained('TheBloke/Mistral-7B-OpenOrca-GGUF', model_type='mistral', model_file='mistral-7b-openorca.Q4_K_M.gguf', **vars(cpu_config)) # **asdict(CtransRunConfig_cpu())
|
104 |
+
#model = AutoModelForCausalLM.from_pretrained('TheBloke/MistralLite-7B-GGUF', model_type='mistral', model_file='mistrallite.Q4_K_M.gguf', **vars(cpu_config)) # **asdict(CtransRunConfig_cpu())
|
105 |
|
106 |
tokenizer = []
|
107 |
|
|
|
194 |
with gr.Row():
|
195 |
chat_height = 500
|
196 |
chatbot = gr.Chatbot(height=chat_height, avatar_images=('user.jfif', 'bot.jpg'),bubble_full_width = False, scale = 1)
|
197 |
+
with gr.Accordion("Open this tab to see the source paragraphs used to generate the answer", open = False):
|
198 |
+
sources = gr.HTML(value = "Source paragraphs with the most relevant text will appear here", height=chat_height, scale = 2)
|
199 |
|
200 |
with gr.Row():
|
201 |
message = gr.Textbox(
|
202 |
+
label="Enter your question here",
|
203 |
lines=1,
|
204 |
)
|
205 |
with gr.Row():
|
chatfuncs/chatfuncs.py
CHANGED
@@ -84,15 +84,14 @@ top_k: int = 3
|
|
84 |
top_p: float = 1
|
85 |
repetition_penalty: float = 1.3
|
86 |
flan_alpaca_repetition_penalty: float = 1.3
|
87 |
-
tinyllama_repetition_penalty: float = 1.5
|
88 |
last_n_tokens: int = 64
|
89 |
-
max_new_tokens: int =
|
90 |
seed: int = 42
|
91 |
reset: bool = False
|
92 |
stream: bool = True
|
93 |
threads: int = threads
|
94 |
batch_size:int = 256
|
95 |
-
context_length:int =
|
96 |
sample = True
|
97 |
|
98 |
|
|
|
84 |
top_p: float = 1
|
85 |
repetition_penalty: float = 1.3
|
86 |
flan_alpaca_repetition_penalty: float = 1.3
|
|
|
87 |
last_n_tokens: int = 64
|
88 |
+
max_new_tokens: int = 256
|
89 |
seed: int = 42
|
90 |
reset: bool = False
|
91 |
stream: bool = True
|
92 |
threads: int = threads
|
93 |
batch_size:int = 256
|
94 |
+
context_length:int = 2048
|
95 |
sample = True
|
96 |
|
97 |
|