Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
import spaces
|
| 2 |
import json
|
| 3 |
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
from huggingface_hub import hf_hub_download
|
| 6 |
|
| 7 |
-
subprocess.run('pip install llama-cpp-python==0.2.75 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124', shell=True)
|
| 8 |
-
subprocess.run('pip install llama-cpp-agent==0.2.10', shell=True)
|
| 9 |
-
|
| 10 |
hf_hub_download(repo_id="bartowski/dolphin-2.9.1-yi-1.5-34b-GGUF", filename="dolphin-2.9.1-yi-1.5-34b-Q6_K.gguf", local_dir = "./models")
|
| 11 |
hf_hub_download(repo_id="crusoeai/dolphin-2.9.1-llama-3-70b-GGUF", filename="dolphin-2.9.1-llama-3-70b.Q3_K_M.gguf", local_dir = "./models")
|
| 12 |
# hf_hub_download(repo_id="bartowski/dolphin-2.9.1-yi-1.5-9b-GGUF", filename="dolphin-2.9.1-yi-1.5-9b-f32.gguf", local_dir = "./models")
|
|
@@ -66,16 +69,7 @@ def respond(
|
|
| 66 |
top_k,
|
| 67 |
repeat_penalty,
|
| 68 |
model,
|
| 69 |
-
):
|
| 70 |
-
from llama_cpp import Llama
|
| 71 |
-
from llama_cpp_agent import LlamaCppAgent
|
| 72 |
-
from llama_cpp_agent import MessagesFormatterType
|
| 73 |
-
from llama_cpp_agent.providers import LlamaCppPythonProvider
|
| 74 |
-
from llama_cpp_agent.chat_history import BasicChatHistory
|
| 75 |
-
from llama_cpp_agent.chat_history.messages import Roles
|
| 76 |
-
print(message)
|
| 77 |
-
print(history)
|
| 78 |
-
|
| 79 |
llm = Llama(
|
| 80 |
model_path=f"models/{model}",
|
| 81 |
flash_attn=True,
|
|
|
|
| 1 |
import spaces
|
| 2 |
import json
|
| 3 |
import subprocess
|
| 4 |
+
from llama_cpp import Llama
|
| 5 |
+
from llama_cpp_agent import LlamaCppAgent
|
| 6 |
+
from llama_cpp_agent import MessagesFormatterType
|
| 7 |
+
from llama_cpp_agent.providers import LlamaCppPythonProvider
|
| 8 |
+
from llama_cpp_agent.chat_history import BasicChatHistory
|
| 9 |
+
from llama_cpp_agent.chat_history.messages import Roles
|
| 10 |
import gradio as gr
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
hf_hub_download(repo_id="bartowski/dolphin-2.9.1-yi-1.5-34b-GGUF", filename="dolphin-2.9.1-yi-1.5-34b-Q6_K.gguf", local_dir = "./models")
|
| 14 |
hf_hub_download(repo_id="crusoeai/dolphin-2.9.1-llama-3-70b-GGUF", filename="dolphin-2.9.1-llama-3-70b.Q3_K_M.gguf", local_dir = "./models")
|
| 15 |
# hf_hub_download(repo_id="bartowski/dolphin-2.9.1-yi-1.5-9b-GGUF", filename="dolphin-2.9.1-yi-1.5-9b-f32.gguf", local_dir = "./models")
|
|
|
|
| 69 |
top_k,
|
| 70 |
repeat_penalty,
|
| 71 |
model,
|
| 72 |
+
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
llm = Llama(
|
| 74 |
model_path=f"models/{model}",
|
| 75 |
flash_attn=True,
|