danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
24.84k stars 2.64k forks source link

[Bug]: Double output of text result when not using --stream #954

Closed derek3131 closed 1 month ago

derek3131 commented 1 month ago

What happened?

I noticed today that I was getting double output if I do NOT use the --stream pattern.

$ yt --transcript https://youtu.be/xhjmgRH91Go\?si\=MlMAUHpTfkRiVdf3 | fabric --stream --pattern summarize

versus

$ yt --transcript https://youtu.be/xhjmgRH91Go\?si\=MlMAUHpTfkRiVdf3 | fabric --pattern summarize

Version check

Relevant log output

Example Output: Steam and Pattern - single output

$ yt --transcript https://youtu.be/xhjmgRH91Go\?si\=MlMAUHpTfkRiVdf3 | fabric --stream --pattern summarize          
**OUTPUT:**                                                                                                                                  

## ONE SENTENCE SUMMARY:                                                                                                                      
Triscuit's thin, crispy biscuits are delightfully wholesome.                                                                                  

## MAIN POINTS:                                                                                                                              
1. Triscuit is thin and crispy.                                                                                                              
2. The biscuits are made from 100% whole grain wheat.                                                                                        
3. They contain no artificial flavors or colors.                                                                                              
4. Triscuit is low in fat and cholesterol-free.                                                                                              
5. It's a good source of fiber.                                                                                                              
6. The biscuits come in various sizes: regular, thin, and mini.                                                                              
7. Triscuit can be enjoyed alone or with toppings.                                                                                            
8. It's suitable for vegans as it contains no animal products.                                                                                
9. Triscuit is a popular snack choice worldwide.                                                                                              
10. The brand offers numerous flavors to cater to diverse tastes.                                                                            

## TAKEAWAYS:                                                                                                                                
1. Triscuit's thinness and crispiness are its unique selling points.                                                                          
2. The biscuits' wholesome ingredients make them a healthier snack option.                                                                    
3. Versatility: Triscuit can be enjoyed plain or with toppings.                                                                              
4. Vegan-friendly, making it suitable for various dietary preferences.                                                                        
5. Wide range of flavors ensures mass appeal and customer satisfaction.taz@vault-713:~/ai_fabric$                                            

Example Output: Just using "--pattern"  - double output

$ yt --transcript https://youtu.be/xhjmgRH91Go\?si\=MlMAUHpTfkRiVdf3 | fabric --pattern summarize                    
# OUTPUT                                                                                                                                      

## ONE SENTENCE SUMMARY:                                                                                                                      
Triscuits are uniquely thin, crispy, and wholesome crackers.                                                                                  

## MAIN POINTS:                                                                                                                              
1. Triscuits are exceptionally thin.                                                                                                          
2. They have a distinctively crisp texture.                                                                                                  
3. Made from simple ingredients: whole grain wheat, oil, and salt.                                                                            
4. Unapologetically wholesome with no artificial preservatives or flavors.                                                                    
5. Come in various sizes and packs for different needs.                                                                                      
6. Ideal for snacking on their own or pairing with dips and toppings.                                                                        
7. Perfect for entertaining, lunches, and parties.                                                                                            
8. Baked, not fried, for a healthier option.                                                                                                  
9. Gluten-free varieties available for those with dietary restrictions.                                                                      
10. Triscuits are widely popular and have been a favorite since 1902.                                                                        

## TAKEAWAYS:                                                                                                                                
1. Thinness is the defining feature of Triscuits.                                                                                            
2. Crispiness makes them uniquely satisfying as a snack.                                                                                      
3. Wholesome ingredients and no artificial additives make them healthier choice.                                                              
4. Versatility allows pairing with various toppings or serving alone.                                                                        
5. Gluten-free options cater to those with dietary restrictions.FRED ==>                                                                      
# OUTPUT                                                                                                                                      

## ONE SENTENCE SUMMARY:                                                                                                                      
Triscuits are uniquely thin, crispy, and wholesome crackers.                                                                                  

## MAIN POINTS:                                                                                                                              
1. Triscuits are exceptionally thin.                                                                                                          
2. They have a distinctively crisp texture.                                                                                                  
3. Made from simple ingredients: whole grain wheat, oil, and salt.                                                                            
4. Unapologetically wholesome with no artificial preservatives or flavors.                                                                    
5. Come in various sizes and packs for different needs.                                                                                      
6. Ideal for snacking on their own or pairing with dips and toppings.                                                                        
7. Perfect for entertaining, lunches, and parties.                                                                                            
8. Baked, not fried, for a healthier option.                                                                                                  
9. Gluten-free varieties available for those with dietary restrictions.                                                                      
10. Triscuits are widely popular and have been a favorite since 1902.                                                                        

## TAKEAWAYS:                                                                                                                                
1. Thinness is the defining feature of Triscuits.                                                                                            
2. Crispiness makes them uniquely satisfying as a snack.                                                                                      
3. Wholesome ingredients and no artificial additives make them healthier choice.                                                              
4. Versatility allows pairing with various toppings or serving alone.                                                                        
5. Gluten-free options cater to those with dietary restrictions.

Relevant screenshots (optional)

No response

fonteijne commented 1 month ago

I have the same issue, but only when using local Ollama models. Which model are you using?

derek3131 commented 1 month ago

Also, local Ollama models.

codellama:13b llama3.1:8b mistral-nemo:12b mixtral:8x7b:47b

fonteijne commented 1 month ago

I just updated to the latest version, and this seems to fix the double output. See https://github.com/danielmiessler/fabric/commit/0ef4e465e4590211b78b0c78fb8c7d4f38ce224a

Could you try running go install github.com/danielmiessler/fabric@latest and let me know if this fixed the issue for you too?

eugeis commented 1 month ago

Yes, should be fixed, please retest.

eugeis commented 1 month ago

I am closing this, please reopen if it is still there.