Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,21 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from llama_cpp import Llama
|
4 |
-
from huggingface_hub import hf_hub_download
|
|
|
|
|
|
|
5 |
|
6 |
model = Llama(
|
7 |
model_path=hf_hub_download(
|
8 |
-
repo_id=os.environ.get("REPO_ID", "
|
9 |
-
filename=os.environ.get("MODEL_FILE", "
|
10 |
)
|
11 |
)
|
12 |
|
13 |
DESCRIPTION = '''
|
14 |
-
#
|
15 |
-
|
16 |
Focused on advancing AI reasoning capabilities.
|
17 |
|
18 |
**To start a new chat**, click "clear" and start a new dialog.
|
@@ -26,8 +29,7 @@ def generate_text(message, history, max_tokens=512, temperature=0.9, top_p=0.95)
|
|
26 |
"""Generate a response using the Llama model."""
|
27 |
temp = ""
|
28 |
response = model.create_chat_completion(
|
29 |
-
messages=[{"role": "
|
30 |
-
{"role": "user", "content": message}],
|
31 |
temperature=temperature,
|
32 |
max_tokens=max_tokens,
|
33 |
top_p=top_p,
|
@@ -44,12 +46,12 @@ with gr.Blocks() as demo:
|
|
44 |
|
45 |
chatbot = gr.ChatInterface(
|
46 |
generate_text,
|
47 |
-
title="
|
48 |
description=" settings below if needed.",
|
49 |
examples=[
|
50 |
["How many r's are in the word strawberry?"],
|
51 |
-
['
|
52 |
-
['
|
53 |
],
|
54 |
cache_examples=False,
|
55 |
fill_height=True
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from llama_cpp import Llama
|
4 |
+
from huggingface_hub import hf_hub_download, login
|
5 |
+
import os
|
6 |
+
|
7 |
+
login(os.getenv("HF_TOKEN"))
|
8 |
|
9 |
model = Llama(
|
10 |
model_path=hf_hub_download(
|
11 |
+
repo_id=os.environ.get("REPO_ID", "Lyte/HuatuoGPT-o1-7B-Q4_K_M-GGUF"),
|
12 |
+
filename=os.environ.get("MODEL_FILE", "huatuogpt-o1-7b-q4_k_m.gguf"),
|
13 |
)
|
14 |
)
|
15 |
|
16 |
DESCRIPTION = '''
|
17 |
+
# FreedomIntelligence/HuatuoGPT-o1-7B | Duplicate the space and set it to private for faster & personal inference for free.
|
18 |
+
HuatuoGPT-o1-7B: an experimental research model developed by the Qwen Team.
|
19 |
Focused on advancing AI reasoning capabilities.
|
20 |
|
21 |
**To start a new chat**, click "clear" and start a new dialog.
|
|
|
29 |
"""Generate a response using the Llama model."""
|
30 |
temp = ""
|
31 |
response = model.create_chat_completion(
|
32 |
+
messages=[{"role": "user", "content": message}],
|
|
|
33 |
temperature=temperature,
|
34 |
max_tokens=max_tokens,
|
35 |
top_p=top_p,
|
|
|
46 |
|
47 |
chatbot = gr.ChatInterface(
|
48 |
generate_text,
|
49 |
+
title="FreedomIntelligence/HuatuoGPT-o1-7B | GGUF Demo",
|
50 |
description=" settings below if needed.",
|
51 |
examples=[
|
52 |
["How many r's are in the word strawberry?"],
|
53 |
+
['How to stop a cough?'],
|
54 |
+
['How do I relieve feet pain?'],
|
55 |
],
|
56 |
cache_examples=False,
|
57 |
fill_height=True
|