miwojc commited on
Commit
0d3459b
1 Parent(s): 519c52a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -3,14 +3,15 @@ import random
3
  import requests
4
  from mtranslate import translate
5
  import streamlit as st
 
6
  MODEL_URL = "https://api-inference.huggingface.co/models/flax-community/papuGaPT2"
7
  PROMPT_LIST = {
8
  "Najsmaczniejszy owoc to...": ["Najsmaczniejszy owoc to "],
9
  "Cześć, mam na imię...": ["Cześć, mam na imię "],
10
  "Największym polskim poetą był...": ["Największym polskim poetą był "],
11
  }
12
-
13
  API_TOKEN = st.secrets['api_token']
 
14
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
15
 
16
  def query(payload, model_url):
@@ -38,8 +39,8 @@ def process(
38
  }
39
  return query(payload, model_name)
40
  # Page
41
- st.set_page_config(page_title="papuGaPT2 (Polish GPT-2) Demo")
42
- st.title("papuGaPT2 (Polish GPT-2")
43
  # Sidebar
44
  st.sidebar.subheader("Configurable parameters")
45
  max_len = st.sidebar.number_input(
@@ -76,7 +77,7 @@ st.markdown(
76
 
77
  To use it, add your text to 'Input Text' box, or click one of the below examples to load them and clik 'Submit' button. The model will generate text based on the entered text (prompt).
78
 
79
- For more information including dataset, training and evaluation procedure, intended use, limitations and bias analysis see the model card at https://huggingface.co/flax-community/papuGaPT2)
80
 
81
  The models were trained with Jax and Flax using TPUs as part of the [Flax/Jax Community Week](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/7104) organised by HuggingFace.
82
  """
 
3
  import requests
4
  from mtranslate import translate
5
  import streamlit as st
6
+
7
  MODEL_URL = "https://api-inference.huggingface.co/models/flax-community/papuGaPT2"
8
  PROMPT_LIST = {
9
  "Najsmaczniejszy owoc to...": ["Najsmaczniejszy owoc to "],
10
  "Cześć, mam na imię...": ["Cześć, mam na imię "],
11
  "Największym polskim poetą był...": ["Największym polskim poetą był "],
12
  }
 
13
  API_TOKEN = st.secrets['api_token']
14
+
15
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
16
 
17
  def query(payload, model_url):
 
39
  }
40
  return query(payload, model_name)
41
  # Page
42
+ st.set_page_config(page_title="papuGaPT2 aka Polish GPT-2 model demo")
43
+ st.title("papuGaPT2 aka Polish GPT-2")
44
  # Sidebar
45
  st.sidebar.subheader("Configurable parameters")
46
  max_len = st.sidebar.number_input(
 
77
 
78
  To use it, add your text to 'Input Text' box, or click one of the below examples to load them and clik 'Submit' button. The model will generate text based on the entered text (prompt).
79
 
80
+ For more information including dataset, training and evaluation procedure, intended use, limitations and bias analysis see the [model card](https://huggingface.co/flax-community/papuGaPT2)
81
 
82
  The models were trained with Jax and Flax using TPUs as part of the [Flax/Jax Community Week](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/7104) organised by HuggingFace.
83
  """