AItool commited on
Commit
1d7f870
·
verified ·
1 Parent(s): 30d0658

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -4,6 +4,7 @@
4
  import os
5
  import streamlit as st
6
  from huggingface_hub import InferenceClient
 
7
 
8
  # Load the API token from an environment variable
9
  api_key = os.getenv("HF_TOKEN")
@@ -25,8 +26,11 @@ with st.form("my_form"):
25
 
26
  # Initialize the full_text variable
27
  full_text = " "
 
28
  # to get different jokes
29
  top_p_init = 0.7
 
 
30
 
31
  if submitted:
32
  top_p_init+=0.2
 
4
  import os
5
  import streamlit as st
6
  from huggingface_hub import InferenceClient
7
+ import random
8
 
9
  # Load the API token from an environment variable
10
  api_key = os.getenv("HF_TOKEN")
 
26
 
27
  # Initialize the full_text variable
28
  full_text = " "
29
+
30
  # to get different jokes
31
  top_p_init = 0.7
32
+ # Generate a random temperature between 0.5 and 1.0
33
+ temperature = random.uniform(0.5, 1.0)
34
 
35
  if submitted:
36
  top_p_init+=0.2