Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,17 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
max_length=max_length)
|
| 13 |
-
|
| 14 |
-
return tokenizer.decode(output[0])
|
| 15 |
-
|
| 16 |
-
context = "Manuel has created RuPERTa-base with the support of HF-Transformers and Google"
|
| 17 |
-
answer = "Manuel"
|
| 18 |
-
|
| 19 |
-
get_question(answer, context)
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
classifier = pipeline("table-question-answering", model="google/tapas-base-finetuned-wtq")
|
| 5 |
+
def main():
|
| 6 |
+
st.title("English to German")
|
| 7 |
|
| 8 |
+
with st.form("text_field"):
|
| 9 |
+
text = st.text_area('enter some english word:')
|
| 10 |
+
# clicked==True only when the button is clicked
|
| 11 |
+
clicked = st.form_submit_button("Submit")
|
| 12 |
+
if clicked:
|
| 13 |
+
results = classifier([text])
|
| 14 |
+
st.json(results)
|
| 15 |
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|