Spaces:
Sleeping
Sleeping
File size: 827 Bytes
f5a396a ac462f6 f5a396a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from langchain.chains import LLMChain
from langchain.llms import HuggingFaceHub
from langchain.prompts import PromptTemplate
import streamlit as st
import os
topic = st.text_input("Enter Topic for the bog")
hub_llm = HuggingFaceHub(repo_id ="HuggingFaceH4/zephyr-7b-beta")
prompt = PromptTemplate(
input_variables = ['keyword'],
template = """
Write a comprehensive article about {keyword} covering the following aspects:
Introduction, History and Background, Key Concepts and Terminology, Use Cases and Applications, Benefits and Drawbacks, Future Outlook, Conclusion
Ensure that the article is well-structured, informative, and at least 1500 words long. Use SEO best practices for content optimization.
""")
hub_chain = LLMChain(prompt=prompt,llm = hub_llm,verbose=True)
st.write(hub_chain.run(topic)) |