mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-23 20:26:15 +00:00
fix problem
This commit is contained in:
parent
0767537606
commit
acf9dbbd82
@ -29,8 +29,8 @@ class ModerLoader:
|
|||||||
if debug:
|
if debug:
|
||||||
print(model)
|
print(model)
|
||||||
|
|
||||||
if self.device == "cuda":
|
# if self.device == "cuda":
|
||||||
model.to(self.device)
|
# model.to(self.device)
|
||||||
|
|
||||||
return model, tokenizer
|
return model, tokenizer
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import json
|
|||||||
import time
|
import time
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
from configs.model_config import *
|
from pilot.configs.model_config import *
|
||||||
vicuna_base_uri = "http://192.168.31.114:21002/"
|
vicuna_base_uri = "http://192.168.31.114:21002/"
|
||||||
vicuna_stream_path = "worker_generate_stream"
|
vicuna_stream_path = "worker_generate_stream"
|
||||||
vicuna_status_path = "worker_get_status"
|
vicuna_status_path = "worker_get_status"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import json
|
import json
|
||||||
import torch
|
import torch
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
from fastchat.serve.inference import generate_stream, compress_module
|
from fastchat.serve.inference import generate_stream
|
||||||
|
|
||||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||||
@ -20,7 +20,6 @@ model = AutoModelForCausalLM.from_pretrained(
|
|||||||
)
|
)
|
||||||
|
|
||||||
def generate(prompt):
|
def generate(prompt):
|
||||||
compress_module(model, device)
|
|
||||||
model.to(device)
|
model.to(device)
|
||||||
print(model, tokenizer)
|
print(model, tokenizer)
|
||||||
params = {
|
params = {
|
||||||
|
Loading…
Reference in New Issue
Block a user