Pablinho commited on
Commit
ea52da6
1 Parent(s): 6be44d2

Update brain.py

Browse files
Files changed (1) hide show
  1. brain.py +2 -2
brain.py CHANGED
@@ -1,6 +1,5 @@
1
  from dotenv import load_dotenv, find_dotenv
2
  from transformers import pipeline
3
- from transformers import pipeline
4
  from langchain_huggingface import HuggingFaceEndpoint
5
  from langchain_core.prompts import PromptTemplate
6
  load_dotenv(find_dotenv())
@@ -44,9 +43,10 @@ def generate_story(scenario, repo_id="mistralai/Mistral-7B-Instruct-v0.2"):
44
  """
45
  prompt = PromptTemplate.from_template(prompt_template)
46
  story = prompt | llm
47
- return story.invoke(input={"segmentation_results": scenario})
48
 
49
 
50
  if __name__ == "__main__":
51
  my_story = generate_story(img2txt("image.jpg"))
52
  print(my_story)
 
 
1
  from dotenv import load_dotenv, find_dotenv
2
  from transformers import pipeline
 
3
  from langchain_huggingface import HuggingFaceEndpoint
4
  from langchain_core.prompts import PromptTemplate
5
  load_dotenv(find_dotenv())
 
43
  """
44
  prompt = PromptTemplate.from_template(prompt_template)
45
  story = prompt | llm
46
+ return story.invoke(input={"scenario": scenario})
47
 
48
 
49
  if __name__ == "__main__":
50
  my_story = generate_story(img2txt("image.jpg"))
51
  print(my_story)
52
+