Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,13 +1,15 @@
1
  import spaces
2
  import json
3
  import subprocess
 
 
 
 
 
4
  import gradio as gr
5
  from huggingface_hub import hf_hub_download, snapshot_download
6
  import os
7
 
8
- subprocess.run('pip install llama-cpp-python==0.2.75 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124', shell=True)
9
- subprocess.run('pip install llama-cpp-agent==0.2.10', shell=True)
10
-
11
  ####
12
  space_link = "https://huggingface.co/spaces/Weyaxi/chat"
13
  all_repo_ggufs = ["bartowski/Einstein-v6.1-Llama3-8B-GGUF", "LoneStriker/Einstein-v4-7B-GGUF"]
@@ -47,7 +49,7 @@ PLACEHOLDER = f"""
47
  <div style="padding: .5rem 1.5rem;">
48
  <h2 style="text-align: left; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;">Cognitive Computations</h2>
49
  <p style="text-align: left; font-size: 16px; line-height: 1.5; margin-bottom: 15px;">{text}</p>
50
- <div style="display: flex; justify-content: flex-end;">
51
  <div style="display: flex; flex-flow: column; justify-content: space-between;">
52
  <span style="display: inline-flex; align-items: center; border-radius: 0.375rem; background-color: rgba(79, 70, 229, 0.1); padding: 0.1rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: #818cf8; margin-top: 2.5px;">
53
  Einstein collection
 
1
  import spaces
2
  import json
3
  import subprocess
4
+ from llama_cpp import Llama
5
+ from llama_cpp_agent import LlamaCppAgent, MessagesFormatterType
6
+ from llama_cpp_agent.providers import LlamaCppPythonProvider
7
+ from llama_cpp_agent.chat_history import BasicChatHistory
8
+ from llama_cpp_agent.chat_history.messages import Roles
9
  import gradio as gr
10
  from huggingface_hub import hf_hub_download, snapshot_download
11
  import os
12
 
 
 
 
13
  ####
14
  space_link = "https://huggingface.co/spaces/Weyaxi/chat"
15
  all_repo_ggufs = ["bartowski/Einstein-v6.1-Llama3-8B-GGUF", "LoneStriker/Einstein-v4-7B-GGUF"]
 
49
  <div style="padding: .5rem 1.5rem;">
50
  <h2 style="text-align: left; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;">Cognitive Computations</h2>
51
  <p style="text-align: left; font-size: 16px; line-height: 1.5; margin-bottom: 15px;">{text}</p>
52
+ <div style="display: flex; justify-content: space-between; align-items: center;">
53
  <div style="display: flex; flex-flow: column; justify-content: space-between;">
54
  <span style="display: inline-flex; align-items: center; border-radius: 0.375rem; background-color: rgba(79, 70, 229, 0.1); padding: 0.1rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: #818cf8; margin-top: 2.5px;">
55
  Einstein collection