Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
import streamlit as st
|
| 3 |
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
| 4 |
from pptx import Presentation
|
|
@@ -9,10 +8,7 @@ import io, tempfile, os, re
|
|
| 9 |
st.set_page_config(page_title="PPTX Smart Enhancer", layout="wide")
|
| 10 |
|
| 11 |
# Load your hosted Hugging Face model
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
model = LlamaForCausalLM.from_pretrained("Faisalkhany/llam1b_finetune")
|
| 15 |
-
# ← change this
|
| 16 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 17 |
model = AutoModelForCausalLM.from_pretrained(MODEL_ID, device_map="auto", torch_dtype="auto")
|
| 18 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
|
@@ -135,4 +131,4 @@ def main():
|
|
| 135 |
mime="application/vnd.openxmlformats-officedocument.presentationml.presentation")
|
| 136 |
|
| 137 |
if __name__=="__main__":
|
| 138 |
-
main()
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
| 3 |
from pptx import Presentation
|
|
|
|
| 8 |
st.set_page_config(page_title="PPTX Smart Enhancer", layout="wide")
|
| 9 |
|
| 10 |
# Load your hosted Hugging Face model
|
| 11 |
+
MODEL_ID = "Faisalkhany/llam1b_finetune" # ← change this
|
|
|
|
|
|
|
|
|
|
| 12 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 13 |
model = AutoModelForCausalLM.from_pretrained(MODEL_ID, device_map="auto", torch_dtype="auto")
|
| 14 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
|
|
|
| 131 |
mime="application/vnd.openxmlformats-officedocument.presentationml.presentation")
|
| 132 |
|
| 133 |
if __name__=="__main__":
|
| 134 |
+
main()
|