Ashraf commited on
Commit
57ee30d
·
verified ·
1 Parent(s): 336c428

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -1,28 +1,28 @@
1
-
2
- # Load model directly
3
- from transformers import pipeline
4
- import gradio as gr
5
- import torch
6
-
7
- # Check if CUDA is available, otherwise use CPU
8
- device = "cuda" if torch.cuda.is_available() else "cpu"
9
-
10
- pipe = pipeline("text-generation", model="microsoft/BioGPT-Large", device=device)
11
-
12
- def question(message, history):
13
-
14
-
15
- # Generate the response
16
- response = pipe(message, max_length=200)[0]['generated_text']
17
-
18
- return response
19
-
20
- #Description in Markdown
21
- description =
22
-
23
-
24
-
25
- program = gr.ChatInterface(question,description=description,title="Microsoft BioGPT Large Chat")
26
-
27
- if __name__ == "__main__":
28
  program.launch()
 
1
+
2
+ # Load model directly
3
+ from transformers import pipeline
4
+ import gradio as gr
5
+ import torch
6
+
7
+ # Check if CUDA is available, otherwise use CPU
8
+ device = "cuda" if torch.cuda.is_available() else "cpu"
9
+
10
+ pipe = pipeline("text-generation", model="microsoft/BioGPT-Large", device=device)
11
+
12
+ def question(message, history):
13
+
14
+
15
+ # Generate the response
16
+ response = pipe(message, max_length=200)[0]['generated_text']
17
+
18
+ return response
19
+
20
+ #Description in Markdown
21
+ description =""
22
+
23
+
24
+
25
+ program = gr.ChatInterface(question,description=description,title="Microsoft BioGPT Large Chat")
26
+
27
+ if __name__ == "__main__":
28
  program.launch()