cyberagent-open-calm-small
Browse files
app.py
CHANGED
@@ -1,12 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
generator = pipeline(
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def generate(text):
|
7 |
result = generator(text)
|
8 |
return result[0]["generated_text"]
|
9 |
|
|
|
10 |
examples = [
|
11 |
["AIによって私達の暮らしは、"],
|
12 |
]
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
generator = pipeline(
|
5 |
+
"text-generation",
|
6 |
+
model="cyberagent/open-calm-small",
|
7 |
+
tokenizer="cyberagent/open-calm-small",
|
8 |
+
)
|
9 |
+
|
10 |
|
11 |
def generate(text):
|
12 |
result = generator(text)
|
13 |
return result[0]["generated_text"]
|
14 |
|
15 |
+
|
16 |
examples = [
|
17 |
["AIによって私達の暮らしは、"],
|
18 |
]
|