Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import
|
| 3 |
-
import ctypes #to run on C api directly
|
| 4 |
-
import llama_cpp
|
| 5 |
from llama_cpp import Llama
|
| 6 |
-
from huggingface_hub import hf_hub_download #load from huggingfaces
|
| 7 |
|
| 8 |
-
|
| 9 |
-
llm = Llama(model_path= hf_hub_download(repo_id="TheBloke/airoboros-l2-13b-gpt4-m2.0-GGML", filename="airoboros-l2-13b-gpt4-m2.0.ggmlv3.q6_K.bin"), n_ctx=2048) #download model from hf/ n_ctx=2048 for high ccontext length
|
| 10 |
|
| 11 |
history = []
|
| 12 |
history.append(["Hi there!", "Hello, how can I help you?"])
|
|
@@ -19,7 +15,7 @@ def generate_text(input_text, history):
|
|
| 19 |
response = output['choices'][0]['text']
|
| 20 |
history.append([input_text, response])
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
with gr.Blocks() as demo:
|
| 25 |
chatbot = gr.Chatbot()
|
|
@@ -30,3 +26,10 @@ with gr.Blocks() as demo:
|
|
| 30 |
|
| 31 |
demo.launch()
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from huggingface_hub import hf_hub_download
|
|
|
|
|
|
|
| 3 |
from llama_cpp import Llama
|
|
|
|
| 4 |
|
| 5 |
+
llm = Llama(model_path=hf_hub_download(repo_id="TheBloke/airoboros-l2-13b-gpt4-m2.0-GGML", filename="airoboros-l2-13b-gpt4-m2.0.ggmlv3.q6_K.bin"), n_ctx=2048)
|
|
|
|
| 6 |
|
| 7 |
history = []
|
| 8 |
history.append(["Hi there!", "Hello, how can I help you?"])
|
|
|
|
| 15 |
response = output['choices'][0]['text']
|
| 16 |
history.append([input_text, response])
|
| 17 |
|
| 18 |
+
return "", history
|
| 19 |
|
| 20 |
with gr.Blocks() as demo:
|
| 21 |
chatbot = gr.Chatbot()
|
|
|
|
| 26 |
|
| 27 |
demo.launch()
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|