Ubik80 commited on
Commit
701a489
·
verified ·
1 Parent(s): 1a934ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -51,7 +51,13 @@ model = OpenAIServerModel(
51
  )
52
 
53
  # Import tool from Hub
54
- image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
 
 
 
 
 
 
55
 
56
  with open("prompts.yaml", 'r') as stream:
57
  prompt_templates = yaml.safe_load(stream)
 
51
  )
52
 
53
  # Import tool from Hub
54
+ HF_API_KEY = os.getenv("HF_TOKEN") # 🔒 Recuperiamo il token dai secrets
55
+
56
+ image_generation_tool = load_tool(
57
+ "agents-course/text-to-image",
58
+ trust_remote_code=True,
59
+ token=HF_API_KEY # ✅ Passiamo il token per autenticare le richieste
60
+ )
61
 
62
  with open("prompts.yaml", 'r') as stream:
63
  prompt_templates = yaml.safe_load(stream)