Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
|
| 8 |
def chat(input_text):
|
| 9 |
-
|
| 10 |
-
output
|
| 11 |
-
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 12 |
-
return response
|
| 13 |
|
| 14 |
iface = gr.Interface(
|
| 15 |
fn=chat,
|
| 16 |
inputs="text",
|
| 17 |
outputs="text",
|
| 18 |
title="Dika AI - MythoMax Lite",
|
| 19 |
-
description="Chatbot AI berbasis MythoMax 13B GGUF, optimized for Hugging Face
|
| 20 |
)
|
| 21 |
|
| 22 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from llama_cpp import Llama
|
| 3 |
|
| 4 |
+
# Load model (gunakan versi GGUF yang ringan)
|
| 5 |
+
model_path = "TheBloke/MythoMax-L2-13B-GGUF/mythomax.gguf"
|
| 6 |
+
llm = Llama(model_path=model_path, n_ctx=2048)
|
| 7 |
|
| 8 |
def chat(input_text):
|
| 9 |
+
output = llm(input_text, max_tokens=100)
|
| 10 |
+
return output["choices"][0]["text"]
|
|
|
|
|
|
|
| 11 |
|
| 12 |
iface = gr.Interface(
|
| 13 |
fn=chat,
|
| 14 |
inputs="text",
|
| 15 |
outputs="text",
|
| 16 |
title="Dika AI - MythoMax Lite",
|
| 17 |
+
description="Chatbot AI berbasis MythoMax 13B GGUF, optimized for Hugging Face CPU!"
|
| 18 |
)
|
| 19 |
|
| 20 |
iface.launch()
|