Spaces:
Runtime error
Runtime error
theonerichy
commited on
Commit
•
6448781
1
Parent(s):
0aeec0a
update
Browse files- app.py +4 -4
- ggml-model-f16-q4_0.bin +1 -1
app.py
CHANGED
@@ -7,17 +7,17 @@ llm = Llama(model_path="ggml-model-f16-q4_0.bin", n_ctx=2048)
|
|
7 |
|
8 |
def generate_text_instruct(input_text):
|
9 |
response = ""
|
10 |
-
txt2tag_prompt = f"Provide me with danbooru tags that accurately
|
11 |
for output in llm(f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {txt2tag_prompt} ASSISTANT: ",
|
12 |
-
echo=False, stream=True, stop=["</s>", "\n", "User:", "<unk>"]):
|
13 |
answer = output['choices'][0]['text']
|
14 |
response += answer
|
15 |
yield response
|
16 |
|
17 |
instruct_interface = gr.Interface(
|
18 |
fn=generate_text_instruct,
|
19 |
-
inputs=gr.inputs.Textbox(lines= 10, label="Enter your
|
20 |
-
outputs=gr.outputs.Textbox(label="
|
21 |
)
|
22 |
|
23 |
with gr.Blocks() as demo:
|
|
|
7 |
|
8 |
def generate_text_instruct(input_text):
|
9 |
response = ""
|
10 |
+
txt2tag_prompt = f"You are a tool that helps tag danbooru images when given a textual image description. Provide me with danbooru tags that accurately fit the following description. {input_text}"
|
11 |
for output in llm(f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {txt2tag_prompt} ASSISTANT: ",
|
12 |
+
echo=False, stream=True, max_tokens=64, stop=["</s>", "\n", "User:", "<unk>"]):
|
13 |
answer = output['choices'][0]['text']
|
14 |
response += answer
|
15 |
yield response
|
16 |
|
17 |
instruct_interface = gr.Interface(
|
18 |
fn=generate_text_instruct,
|
19 |
+
inputs=gr.inputs.Textbox(lines= 10, label="Enter your image description"),
|
20 |
+
outputs=gr.outputs.Textbox(label="danbooru tags"),
|
21 |
)
|
22 |
|
23 |
with gr.Blocks() as demo:
|
ggml-model-f16-q4_0.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 7323305088
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a214d083617ae4cb2971d73235043d3505407017cd0d98639ee762618e09c177
|
3 |
size 7323305088
|