Spaces:
Running
Running
Commit
·
dc569e4
1
Parent(s):
267a2df
✅ Final: Switched to Phi-1.5 and cleaned requirements.txt
Browse files- app.py +2 -3
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -6,13 +6,12 @@ import gradio as gr
|
|
| 6 |
from PyPDF2 import PdfReader
|
| 7 |
from docx import Document as DocxDocument
|
| 8 |
from pptx import Presentation
|
| 9 |
-
from transformers import pipeline, AutoTokenizer,
|
| 10 |
from langchain_community.vectorstores import FAISS
|
| 11 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 12 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 13 |
from langchain_core.documents import Document
|
| 14 |
|
| 15 |
-
#extra
|
| 16 |
# Load Reasoning Model (CPU-friendly with better reasoning)
|
| 17 |
model_id = "microsoft/phi-1_5"
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
@@ -178,7 +177,7 @@ def ask_question(question):
|
|
| 178 |
with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
|
| 179 |
gr.Markdown("""
|
| 180 |
# 📚 AI Study Assistant
|
| 181 |
-
Upload your lecture slide/text file, ask questions, and get intelligent answers powered by
|
| 182 |
""")
|
| 183 |
|
| 184 |
with gr.Tab("Upload & Ask"):
|
|
|
|
| 6 |
from PyPDF2 import PdfReader
|
| 7 |
from docx import Document as DocxDocument
|
| 8 |
from pptx import Presentation
|
| 9 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
| 10 |
from langchain_community.vectorstores import FAISS
|
| 11 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 12 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 13 |
from langchain_core.documents import Document
|
| 14 |
|
|
|
|
| 15 |
# Load Reasoning Model (CPU-friendly with better reasoning)
|
| 16 |
model_id = "microsoft/phi-1_5"
|
| 17 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
|
|
| 177 |
with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
|
| 178 |
gr.Markdown("""
|
| 179 |
# 📚 AI Study Assistant
|
| 180 |
+
Upload your lecture slide/text file, ask questions, and get intelligent answers powered by Phi-1.5.
|
| 181 |
""")
|
| 182 |
|
| 183 |
with gr.Tab("Upload & Ask"):
|
requirements.txt
CHANGED
|
@@ -6,6 +6,6 @@ python-docx
|
|
| 6 |
gradio
|
| 7 |
PyPDF2
|
| 8 |
langchain
|
| 9 |
-
sentence-transformers
|
| 10 |
langchain_community
|
|
|
|
| 11 |
accelerate
|
|
|
|
| 6 |
gradio
|
| 7 |
PyPDF2
|
| 8 |
langchain
|
|
|
|
| 9 |
langchain_community
|
| 10 |
+
sentence-transformers
|
| 11 |
accelerate
|