Spaces:
Runtime error
Runtime error
Márk Vince Varga
commited on
l;ewrpiop9iti;hoeraerw
Browse files- app.py +13 -0
- requirements.txt +0 -2
app.py
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from llama_cpp import Llama
|
| 3 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
# Install explicitly before importing
|
| 5 |
+
try:
|
| 6 |
+
import llama_cpp
|
| 7 |
+
except ImportError:
|
| 8 |
+
subprocess.check_call([
|
| 9 |
+
sys.executable, "-m", "pip", "install",
|
| 10 |
+
"llama-cpp-python",
|
| 11 |
+
"--extra-index-url", "https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
| 12 |
+
])
|
| 13 |
+
|
| 14 |
import gradio as gr
|
| 15 |
from llama_cpp import Llama
|
| 16 |
from huggingface_hub import hf_hub_download
|
requirements.txt
CHANGED
|
@@ -1,4 +1,2 @@
|
|
| 1 |
-
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 2 |
-
llama-cpp-python
|
| 3 |
gradio
|
| 4 |
huggingface_hub
|
|
|
|
|
|
|
|
|
|
| 1 |
gradio
|
| 2 |
huggingface_hub
|