Spaces:
Sleeping
Sleeping
Update pages/model.py
Browse files- pages/model.py +23 -0
pages/model.py
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from langchain.prompts import ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate
|
| 4 |
+
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 5 |
+
|
| 6 |
+
os.environ["HUGGINGFACEHUB_API_KEY"] = os.getenv('HF_Token')
|
| 7 |
+
os.environ["HF_TOKEN"] = os.getenv('HF_Token')
|
| 8 |
+
|
| 9 |
+
st.set_page_config(page_title="Tube2Insight 🎬", layout="centered")
|
| 10 |
+
st.markdown("## 🎥 Tube2Insight\n*Summarize any YouTube video using LLM!*")
|
| 11 |
+
|
| 12 |
+
video_url = st.text_input("📺 Paste a YouTube video link")
|
| 13 |
+
|
| 14 |
+
with st.expander("ℹ️ How It Works", expanded=False):
|
| 15 |
+
st.markdown("""
|
| 16 |
+
1. Enter the YouTube URL 🎯
|
| 17 |
+
2. The app grabs the transcript 📝
|
| 18 |
+
3. LLaMA summarizes it using smart prompts 🦙
|
| 19 |
+
4. You get a quick summary without watching the whole video! ⚡
|
| 20 |
+
""")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|