Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -190,6 +190,11 @@ class BERTDataset(Dataset):
|
|
190 |
def __len__(self):
|
191 |
return (len(self.labels))
|
192 |
|
|
|
|
|
|
|
|
|
|
|
193 |
# Kobert_softmax
|
194 |
class BERTClassifier(nn.Module):
|
195 |
def __init__(self,
|
@@ -614,16 +619,16 @@ with gr.Blocks() as app:
|
|
614 |
choices=[f"{k}. {v}" for k, v in options.items()],
|
615 |
label="π€ μνλ μ±λ΄ μ€νμΌ μ ν"
|
616 |
)
|
617 |
-
diary_input = gr.Textbox(label="π μ€λμ ν루 κΈ°λ‘νκΈ°", placeholder="ex)μ€λ μνκ°μ λ§μλ κ±Έ λ§μ΄ λ¨Ήμ΄μ μμ² μ λ¬μ΄")
|
618 |
-
image_input = gr.Image(type="pil", label="π· μΌκ΅΄ νμ μ¬μ§ μ
λ‘λ")
|
619 |
playlist_input = gr.Radio(["λΉμ·ν", "μλ°λ"], label="π§ μ€λμ κ°μ κ³Ό γ
γ
λλ νλ μ΄λ¦¬μ€νΈ μΆμ² λ°κΈ°")
|
|
|
|
|
620 |
submit_btn = gr.Button("π λΆμ μμ")
|
621 |
|
622 |
with gr.Column():
|
623 |
output_playlist = gr.Dataframe(label="π§ μΆμ² νλ μ΄λ¦¬μ€νΈ ")
|
624 |
output_comment = gr.Textbox(label="π¬ AI μ½λ©νΈ")
|
625 |
output_topics = gr.Textbox(label="π μΆμ² μΌκΈ° μ½ν
μΈ ")
|
626 |
-
output_image = gr.Image(label="πΌοΈ μμ±λ μ€λμ κ°μ μΊλ¦ν°", type="pil", width=
|
627 |
|
628 |
# λ²νΌ ν΄λ¦ μ΄λ²€νΈ μ°κ²°
|
629 |
submit_btn.click(
|
|
|
190 |
def __len__(self):
|
191 |
return (len(self.labels))
|
192 |
|
193 |
+
|
194 |
+
tokenizer = KoBERTTokenizer.from_pretrained('skt/kobert-base-v1')
|
195 |
+
bertmodel = BertModel.from_pretrained('skt/kobert-base-v1', return_dict=False)
|
196 |
+
vocab = nlp.vocab.BERTVocab.from_sentencepiece(tokenizer.vocab_file, padding_token='[PAD]')
|
197 |
+
|
198 |
# Kobert_softmax
|
199 |
class BERTClassifier(nn.Module):
|
200 |
def __init__(self,
|
|
|
619 |
choices=[f"{k}. {v}" for k, v in options.items()],
|
620 |
label="π€ μνλ μ±λ΄ μ€νμΌ μ ν"
|
621 |
)
|
|
|
|
|
622 |
playlist_input = gr.Radio(["λΉμ·ν", "μλ°λ"], label="π§ μ€λμ κ°μ κ³Ό γ
γ
λλ νλ μ΄λ¦¬μ€νΈ μΆμ² λ°κΈ°")
|
623 |
+
diary_input = gr.Textbox(label="π μ€λμ ν루 κΈ°λ‘νκΈ°", placeholder="ex)μ€λ μνκ°μ λ§μλ κ±Έ λ§μ΄ λ¨Ήμ΄μ μμ² μ λ¬μ΄")
|
624 |
+
image_input = gr.Image(type="pil", label="π· μΌκ΅΄ νμ μ¬μ§ μ
λ‘λ", width=256, height=256)
|
625 |
submit_btn = gr.Button("π λΆμ μμ")
|
626 |
|
627 |
with gr.Column():
|
628 |
output_playlist = gr.Dataframe(label="π§ μΆμ² νλ μ΄λ¦¬μ€νΈ ")
|
629 |
output_comment = gr.Textbox(label="π¬ AI μ½λ©νΈ")
|
630 |
output_topics = gr.Textbox(label="π μΆμ² μΌκΈ° μ½ν
μΈ ")
|
631 |
+
output_image = gr.Image(label="πΌοΈ μμ±λ μ€λμ κ°μ μΊλ¦ν°", type="pil", width=256, height=256)
|
632 |
|
633 |
# λ²νΌ ν΄λ¦ μ΄λ²€νΈ μ°κ²°
|
634 |
submit_btn.click(
|