Skip to content

Commit

Permalink
debugt
Browse files Browse the repository at this point in the history
  • Loading branch information
manufy committed May 17, 2024
1 parent 6a10064 commit f2c1580
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions 3-experiments/1-photo-story-teller/photostoryteller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
print("----- setting up application -----")
from dotenv import find_dotenv, load_dotenv
import os
import requests
import streamlit as st

HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

st.write(f"El Htoken es: {HUGGINGFACEHUB_API_TOKEN}")
st.write(f"El Otoken es: {OPENAI_API_KEY}")


print("----- setting up log level to error and ignoring user warnings -----")
Expand Down Expand Up @@ -84,11 +90,12 @@ def generate_story(scenario):
#story=generate_story(scenario)
##print(story)

import requests


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 @@ -102,14 +109,14 @@ def text2speech(message):
#print("----- calling text2speech -----")

#text2speech("hello world")
import streamlit as st




def main():
st.set_page_config(page_title="Photo Story Teller", page_icon="📸", layout="wide")
st.header("Photo Story Teller")
st.write(f"El token es: {HUGGINGFACEHUB_API_TOKEN}")

uploaded_file = st.file_uploader("Choose a photo...", type="jpg")
if uploaded_file is not None:
print("uploaded file")
Expand Down

0 comments on commit f2c1580

Please sign in to comment.