彭见峡
commited on
Commit
·
ff6f314
1
Parent(s):
276b6a9
移除torch依赖
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from argparse import ArgumentParser
|
|
10 |
import gradio as gr
|
11 |
import mdtex2html
|
12 |
|
13 |
-
import torch
|
14 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
15 |
from transformers.generation import GenerationConfig
|
16 |
|
@@ -110,8 +110,8 @@ def _parse_text(text):
|
|
110 |
def _gc():
|
111 |
import gc
|
112 |
gc.collect()
|
113 |
-
if torch.cuda.is_available():
|
114 |
-
|
115 |
|
116 |
|
117 |
def _launch_demo(args, model, tokenizer, config):
|
|
|
10 |
import gradio as gr
|
11 |
import mdtex2html
|
12 |
|
13 |
+
# import torch
|
14 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
15 |
from transformers.generation import GenerationConfig
|
16 |
|
|
|
110 |
def _gc():
|
111 |
import gc
|
112 |
gc.collect()
|
113 |
+
# if torch.cuda.is_available():
|
114 |
+
# torch.cuda.empty_cache()
|
115 |
|
116 |
|
117 |
def _launch_demo(args, model, tokenizer, config):
|