engrharis commited on
Commit
7f63e62
·
verified ·
1 Parent(s): 4142706

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -52,7 +52,9 @@ def extract_text(file):
52
 
53
  # Urdu content generation model (replace with your preferred model)
54
  urdu_gen_model_name = "mwz/UrduGPT2" # Replace placeholder
55
- urdu_gen_pipe = pipeline("text-generation", model=urdu_gen_model_name)
 
 
56
 
57
 
58
  def answer_questions(document, question):
@@ -90,4 +92,4 @@ def main():
90
  st.warning("Couldn't find an answer. Try rephrasing your question.")
91
 
92
  if __name__ == "__main__":
93
- main()
 
52
 
53
  # Urdu content generation model (replace with your preferred model)
54
  urdu_gen_model_name = "mwz/UrduGPT2" # Replace placeholder
55
+
56
+ # Load the model using TensorFlow weights
57
+ urdu_gen_pipe = pipeline("text-generation", model=urdu_gen_model_name, framework="tf")
58
 
59
 
60
  def answer_questions(document, question):
 
92
  st.warning("Couldn't find an answer. Try rephrasing your question.")
93
 
94
  if __name__ == "__main__":
95
+ main()