Skip to content

Commit

Permalink
token fix
Browse files Browse the repository at this point in the history
  • Loading branch information
manufy committed May 17, 2024
1 parent 0f95c5e commit eb1fc18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 3 additions & 4 deletions 3-experiments/1-photo-story-teller/photostoryteller.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def generate_story(scenario):
def text2speech(message):
API_URL = "https://api-inference.huggingface.co/models/espnet/kan-bayashi_ljspeech_vits"
headers = {"Authorization": f"Bearer {HUGGINGFACEHUB_API_TOKEN}"}
st.write(f"llamando a huggingface: {headers}")

payload = {
"inputs": message
}
Expand All @@ -115,8 +115,7 @@ def text2speech(message):
def main():
st.set_page_config(page_title="Photo Story Teller", page_icon="📸", layout="wide")
st.header("Photo Story Teller")
st.write(f"El Htoken es: {HUGGINGFACEHUB_API_TOKEN}")
st.write(f"El Otoken es: {OPENAI_API_KEY}")

uploaded_file = st.file_uploader("Choose a photo...", type="jpg")
if uploaded_file is not None:
print("uploaded file")
Expand All @@ -126,7 +125,7 @@ def main():
st.image(uploaded_file, caption="Uploaded photo", use_column_width=True)
st.write("Generating IMG2TEXT scenario...")
scenario = img2text(uploaded_file.name)
st.write("Generating LLM scenario...")
st.write("Generating LLM story...")
story = generate_story(scenario)
st.write("Audio TTS output...")
text2speech(story)
Expand Down
3 changes: 3 additions & 0 deletions emptyenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
export HUGGINGFACEHUB_API_TOKEN="NOTOKEN"
export OPENAI_API_KEY="NOKEY"
3 changes: 3 additions & 0 deletions showenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo $HUGGINGFACEHUB_API_TOKEN
echo $OPENAI_API_KEY

0 comments on commit eb1fc18

Please sign in to comment.