Spaces:
Running
Running
bilgeyucel
commited on
Commit
•
6bf02ba
1
Parent(s):
85f65db
A bas workaround for adding a node to pipeline
Browse files
app.py
CHANGED
@@ -26,9 +26,9 @@ Caption:
|
|
26 |
""")
|
27 |
|
28 |
hf_api_key = os.environ["HF_API_KEY"]
|
29 |
-
captioning_pipeline = Pipeline()
|
30 |
|
31 |
def generate_caption(image_file_paths, model_name):
|
|
|
32 |
prompt_node = PromptNode(model_name_or_path=model_name, api_key=hf_api_key, default_prompt_template=prompt_template, model_kwargs={"trust_remote_code":True})
|
33 |
captioning_pipeline.add_node(component=image_to_text, name="image_to_text", inputs=["File"])
|
34 |
captioning_pipeline.add_node(component=prompt_node, name="prompt_node", inputs=["image_to_text"])
|
|
|
26 |
""")
|
27 |
|
28 |
hf_api_key = os.environ["HF_API_KEY"]
|
|
|
29 |
|
30 |
def generate_caption(image_file_paths, model_name):
|
31 |
+
captioning_pipeline = Pipeline()
|
32 |
prompt_node = PromptNode(model_name_or_path=model_name, api_key=hf_api_key, default_prompt_template=prompt_template, model_kwargs={"trust_remote_code":True})
|
33 |
captioning_pipeline.add_node(component=image_to_text, name="image_to_text", inputs=["File"])
|
34 |
captioning_pipeline.add_node(component=prompt_node, name="prompt_node", inputs=["image_to_text"])
|