CaioXapelaum commited on
Commit
df6b11b
1 Parent(s): f93e9ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -37
app.py CHANGED
@@ -13,35 +13,20 @@ llm = None
13
  llm_model = None
14
 
15
  hf_hub_download(
16
- repo_id="unsloth/Reflection-Llama-3.1-70B-GGUF",
17
- filename="Reflection-Llama-3.1-70B.Q3_K_L.gguf",
18
  local_dir = "./models"
19
  )
20
 
21
- hf_hub_download(
22
- repo_id="jhofseth/Reflection-Llama-3.1-70B-GGUF",
23
- filename="Reflection-Llama-3.1-70B-IQ3_XXS.gguf",
24
- local_dir = "./models"
25
- )
26
-
27
- hf_hub_download(
28
- repo_id="bartowski/Reflection-Llama-3.1-70B-GGUF",
29
- filename="Reflection-Llama-3.1-70B.imatrix",
30
- local_dir = "./random"
31
- )
32
 
33
  def get_messages_formatter_type(model_name):
34
- if "Llama" in model_name:
35
- return MessagesFormatterType.LLAMA_3
36
- else:
37
- raise ValueError(f"Unsupported model: {model_name}")
38
-
39
 
40
  @spaces.GPU
41
  def respond(
42
  message,
43
  history: list[tuple[str, str]],
44
- model,
45
  system_message,
46
  max_tokens,
47
  temperature,
@@ -108,24 +93,9 @@ def respond(
108
  outputs += output
109
  yield outputs
110
 
111
- description = """<p><center>
112
- <a href="https://huggingface.co/mattshumer/ref_70_e3" target="_blank">[Reflection Llama 3.1 70B Correct Weights]</a>
113
- <a href="https://huggingface.co/mattshumer/Reflection-Llama-3.1-70B" target="_blank">[Old Repo]</a>
114
- <a href="https://huggingface.co/unsloth/Reflection-Llama-3.1-70B-GGUF" target="_blank">[Reflection-Llama-3.1-70B-GGUF]</a>
115
-
116
- </center></p>
117
- """
118
-
119
  demo = gr.ChatInterface(
120
- respond,
121
  additional_inputs=[
122
- gr.Dropdown([
123
- "Reflection-Llama-3.1-70B.Q3_K_L.gguf",
124
- "Reflection-Llama-3.1-70B-IQ3_XXS.gguf"
125
- ],
126
- value="Reflection-Llama-3.1-70B.Q3_K_L.gguf",
127
- label="Model"
128
- ),
129
  gr.Textbox(value="You are a world-class AI system, capable of complex reasoning and reflection. Reason through the query inside <thinking> tags, and then provide your final response inside <output> tags. If you detect that you made a mistake in your reasoning at any point, correct yourself inside <reflection> tags.", label="System message"),
130
  gr.Slider(minimum=1, maximum=8192, value=2048, step=1, label="Max tokens"),
131
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
@@ -168,8 +138,8 @@ demo = gr.ChatInterface(
168
  undo_btn="Undo",
169
  clear_btn="Clear",
170
  submit_btn="Send",
171
- title="Reflection Llama-3.1 70B",
172
- description=description,
173
  chatbot=gr.Chatbot(
174
  scale=1,
175
  likeable=False,
 
13
  llm_model = None
14
 
15
  hf_hub_download(
16
+ repo_id="TheBloke/Open_Gpt4_8x7B_v0.2-GGUF",
17
+ filename="open_gpt4_8x7b_v0.2.Q5_K_M.gguf",
18
  local_dir = "./models"
19
  )
20
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  def get_messages_formatter_type(model_name):
23
+ return MessagesFormatterType.ALPACA
 
 
 
 
24
 
25
  @spaces.GPU
26
  def respond(
27
  message,
28
  history: list[tuple[str, str]],
29
+ model="open_gpt4_8x7b_v0.2.Q5_K_M.gguf",
30
  system_message,
31
  max_tokens,
32
  temperature,
 
93
  outputs += output
94
  yield outputs
95
 
 
 
 
 
 
 
 
 
96
  demo = gr.ChatInterface(
97
+ fn=respond,
98
  additional_inputs=[
 
 
 
 
 
 
 
99
  gr.Textbox(value="You are a world-class AI system, capable of complex reasoning and reflection. Reason through the query inside <thinking> tags, and then provide your final response inside <output> tags. If you detect that you made a mistake in your reasoning at any point, correct yourself inside <reflection> tags.", label="System message"),
100
  gr.Slider(minimum=1, maximum=8192, value=2048, step=1, label="Max tokens"),
101
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
 
138
  undo_btn="Undo",
139
  clear_btn="Clear",
140
  submit_btn="Send",
141
+ title="OpenGPT4",
142
+ description="Chat with *GPT-4* for free!",
143
  chatbot=gr.Chatbot(
144
  scale=1,
145
  likeable=False,