ogawa0071 commited on
Commit
61e98c3
1 Parent(s): 4eeb87b

cyberagent-open-calm-small

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +22 -0
  3. requirements.txt +2 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Cyberagent Open Calm Small
3
  emoji: 🦀
4
  colorFrom: indigo
5
  colorTo: blue
 
1
  ---
2
+ title: CyberAgent OpenCALM-Small
3
  emoji: 🦀
4
  colorFrom: indigo
5
  colorTo: blue
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ generator = pipeline("text-generation", model="cyberagent/open-calm-small")
5
+
6
+ def generate(text):
7
+ result = generator(text)
8
+ return result[0]["generated_text"]
9
+
10
+ examples = [
11
+ ["AIによって私達の暮らしは、"],
12
+ ]
13
+
14
+ demo = gr.Interface(
15
+ fn=generate,
16
+ inputs=gr.Textbox(lines=5, label="Input Text"),
17
+ outputs=gr.Textbox(lines=5, label="Generated Text"),
18
+ examples=examples,
19
+ description="# [CyberAgent OpenCALM-Small](https://huggingface.co/cyberagent/open-calm-small)",
20
+ )
21
+
22
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio
2
+ transformers