Spaces:
Runtime error
Runtime error
prateekagrawal
commited on
Commit
β’
c7070e4
1
Parent(s):
9afe3a7
Replaced random checkbox
Browse files- README.md +3 -3
- apps/inference.py +2 -4
- mlm_custom/mlm_test_config.csv +1 -1
- mlm_custom/test_mlm.py +6 -5
- multiapp.py +1 -1
- requirements.txt +1 -4
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title: Roberta
|
3 |
-
emoji:
|
4 |
colorFrom: green
|
5 |
-
colorTo:
|
6 |
sdk: streamlit
|
7 |
app_file: app.py
|
8 |
pinned: false
|
|
|
1 |
---
|
2 |
+
title: Roberta Hindi
|
3 |
+
emoji: π
|
4 |
colorFrom: green
|
5 |
+
colorTo: gray
|
6 |
sdk: streamlit
|
7 |
app_file: app.py
|
8 |
pinned: false
|
apps/inference.py
CHANGED
@@ -37,7 +37,7 @@ def app():
|
|
37 |
|
38 |
models_list = list(cfg["models"].keys())
|
39 |
|
40 |
-
models = st.multiselect("Choose models", models_list, models_list
|
41 |
|
42 |
target_text_path = "./mlm_custom/mlm_targeted_text.csv"
|
43 |
target_text_df = pd.read_csv(target_text_path)
|
@@ -46,14 +46,12 @@ def app():
|
|
46 |
|
47 |
st.sidebar.title("Hindi MLM")
|
48 |
|
49 |
-
pick_random = st.sidebar.checkbox("Pick any random text")
|
50 |
-
|
51 |
results_df = pd.DataFrame(columns=["Model Name", "Filled Token", "Filled Text"])
|
52 |
|
53 |
model_names = []
|
54 |
filled_masked_texts = []
|
55 |
filled_tokens = []
|
56 |
-
|
57 |
if pick_random:
|
58 |
random_text = texts[random.randint(0, texts.shape[0] - 1)]
|
59 |
masked_text = st.text_area("Please type a masked sentence to fill", random_text)
|
|
|
37 |
|
38 |
models_list = list(cfg["models"].keys())
|
39 |
|
40 |
+
models = st.multiselect("Choose models", models_list, models_list)
|
41 |
|
42 |
target_text_path = "./mlm_custom/mlm_targeted_text.csv"
|
43 |
target_text_df = pd.read_csv(target_text_path)
|
|
|
46 |
|
47 |
st.sidebar.title("Hindi MLM")
|
48 |
|
|
|
|
|
49 |
results_df = pd.DataFrame(columns=["Model Name", "Filled Token", "Filled Text"])
|
50 |
|
51 |
model_names = []
|
52 |
filled_masked_texts = []
|
53 |
filled_tokens = []
|
54 |
+
pick_random = st.checkbox("Pick any random text")
|
55 |
if pick_random:
|
56 |
random_text = texts[random.randint(0, texts.shape[0] - 1)]
|
57 |
masked_text = st.text_area("Please type a masked sentence to fill", random_text)
|
mlm_custom/mlm_test_config.csv
CHANGED
@@ -3,4 +3,4 @@ flax-community/roberta-hindi,,,TRUE,TRUE,TRUE
|
|
3 |
mrm8488/HindiBERTa,,,FALSE,TRUE,TRUE
|
4 |
ai4bharat/indic-bert,,,FALSE,FALSE,FALSE
|
5 |
neuralspace-reverie/indic-transformers-hi-bert,,,FALSE,TRUE,TRUE
|
6 |
-
surajp/RoBERTa-hindi-guj-san,,,FALSE,TRUE,TRUE
|
|
|
3 |
mrm8488/HindiBERTa,,,FALSE,TRUE,TRUE
|
4 |
ai4bharat/indic-bert,,,FALSE,FALSE,FALSE
|
5 |
neuralspace-reverie/indic-transformers-hi-bert,,,FALSE,TRUE,TRUE
|
6 |
+
surajp/RoBERTa-hindi-guj-san,,,FALSE,TRUE,TRUE
|
mlm_custom/test_mlm.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
-
import pandas as pd
|
2 |
-
import numpy as np
|
3 |
-
from transformers import AutoTokenizer, RobertaModel, AutoModel, AutoModelForMaskedLM
|
4 |
-
from transformers import pipeline
|
5 |
-
import os
|
6 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
class MLMTest():
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import json
|
2 |
+
import os
|
3 |
+
|
4 |
+
import numpy as np
|
5 |
+
import pandas as pd
|
6 |
+
from transformers import (AutoModel, AutoModelForMaskedLM, AutoTokenizer,
|
7 |
+
RobertaModel, pipeline)
|
8 |
|
9 |
|
10 |
class MLMTest():
|
multiapp.py
CHANGED
@@ -11,7 +11,7 @@ class MultiApp:
|
|
11 |
self.apps.append({"title": title, "function": func})
|
12 |
|
13 |
def run(self):
|
14 |
-
|
15 |
app = st.sidebar.selectbox("", self.apps, format_func=lambda app: app["title"])
|
16 |
|
17 |
app["function"]()
|
|
|
11 |
self.apps.append({"title": title, "function": func})
|
12 |
|
13 |
def run(self):
|
14 |
+
st.sidebar.header("Navigation")
|
15 |
app = st.sidebar.selectbox("", self.apps, format_func=lambda app: app["title"])
|
16 |
|
17 |
app["function"]()
|
requirements.txt
CHANGED
@@ -1,6 +1,3 @@
|
|
1 |
streamlit
|
2 |
torch
|
3 |
-
transformers
|
4 |
-
jax
|
5 |
-
jaxlib
|
6 |
-
flax
|
|
|
1 |
streamlit
|
2 |
torch
|
3 |
+
transformers
|
|
|
|
|
|