Spaces:
Sleeping
Sleeping
Commit
·
db134f6
1
Parent(s):
d386ade
Add application file
Browse files
app.py
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
from
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
|
7 |
def generate_text(prompt):
|
8 |
-
|
9 |
-
return result[0]["generated_text"]
|
10 |
|
11 |
iface = gr.Interface(fn=generate_text,
|
12 |
inputs="text",
|
13 |
outputs="text",
|
14 |
-
title="
|
15 |
|
16 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from llama_cpp import Llama
|
3 |
|
4 |
+
# gguf形式のモデルファイルのパスを指定してロード
|
5 |
+
llm = Llama(model_path="Mori-kamiyama/sarashina2-13b-r1/unsloth.Q8_0.gguf")
|
6 |
|
7 |
def generate_text(prompt):
|
8 |
+
return llm(prompt)
|
|
|
9 |
|
10 |
iface = gr.Interface(fn=generate_text,
|
11 |
inputs="text",
|
12 |
outputs="text",
|
13 |
+
title="GGUFモデルテキストジェネレーター")
|
14 |
|
15 |
iface.launch()
|