initial commit
Browse files- README.md +5 -5
- app.py +19 -0
- requirements.txt +3 -0
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
1 |
---
|
2 |
+
title: Gpt 2 Secret
|
3 |
+
emoji: 😻
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: pink
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.39.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
from transformers import BertTokenizer, BertModel
|
4 |
+
import torch
|
5 |
+
|
6 |
+
|
7 |
+
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
8 |
+
|
9 |
+
def Bemenet(bemenet):
|
10 |
+
return tokenizer.tokenize("[CLS] " + bemenet + " [SEP]")
|
11 |
+
|
12 |
+
|
13 |
+
interface = gr.Interface(fn=Bemenet,
|
14 |
+
title="Cím..",
|
15 |
+
description="Leírás..",
|
16 |
+
inputs="text",
|
17 |
+
outputs="text")
|
18 |
+
|
19 |
+
interface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
tensorflow
|
3 |
+
torch
|