Spaces:
Runtime error
Runtime error
ooferdoodles
commited on
Commit
·
6cbee0d
1
Parent(s):
0ffe560
bruh
Browse files- app.py +6 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -4,11 +4,15 @@ from text2tags import TaggerLlama
|
|
4 |
model = TaggerLlama()
|
5 |
|
6 |
|
7 |
-
def predict(caption, max_tokens, temperature, top_k, top_p, repeat_penalty):
|
8 |
tags = model.predict_tags(caption, max_tokens=max_tokens, temperature=temperature,
|
9 |
top_k=top_k, top_p=top_p, repeat_penalty=repeat_penalty)
|
10 |
return ', '.join(tags)
|
11 |
|
|
|
|
|
|
|
|
|
12 |
|
13 |
demo = gr.Interface(
|
14 |
fn=predict,
|
@@ -22,7 +26,7 @@ demo = gr.Interface(
|
|
22 |
],
|
23 |
outputs="text",
|
24 |
title="Text2Tags",
|
25 |
-
description=
|
26 |
examples=[
|
27 |
["Minato Aqua from hololive with pink and blue twintails in a blue maid outfit"],
|
28 |
],
|
|
|
4 |
model = TaggerLlama()
|
5 |
|
6 |
|
7 |
+
def predict(caption, max_tokens=128, temperature=0.8, top_k=40, top_p=0.95, repeat_penalty=1.1):
|
8 |
tags = model.predict_tags(caption, max_tokens=max_tokens, temperature=temperature,
|
9 |
top_k=top_k, top_p=top_p, repeat_penalty=repeat_penalty)
|
10 |
return ', '.join(tags)
|
11 |
|
12 |
+
description = """
|
13 |
+
### Enter a caption to extract danbooru tags from it.
|
14 |
+
[ ![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white) ](https://github.com/DatboiiPuntai/text2tags-lib)
|
15 |
+
"""
|
16 |
|
17 |
demo = gr.Interface(
|
18 |
fn=predict,
|
|
|
26 |
],
|
27 |
outputs="text",
|
28 |
title="Text2Tags",
|
29 |
+
description=description,
|
30 |
examples=[
|
31 |
["Minato Aqua from hololive with pink and blue twintails in a blue maid outfit"],
|
32 |
],
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
|
|
1 |
+
text2tags-lib
|