Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Lmdeploy
Commits
0d21f366
Unverified
Commit
0d21f366
authored
Aug 16, 2023
by
AllentDan
Committed by
GitHub
Aug 16, 2023
Browse files
Adjust dependency of gradio server (#236)
* import if lib directory exists * only modify app.py
parent
f06db80d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lmdeploy/serve/gradio/app.py
lmdeploy/serve/gradio/app.py
+2
-2
No files found.
lmdeploy/serve/gradio/app.py
View file @
0d21f366
...
...
@@ -13,8 +13,6 @@ from lmdeploy import turbomind as tm
from
lmdeploy.model
import
MODELS
from
lmdeploy.serve.gradio.css
import
CSS
from
lmdeploy.serve.turbomind.chatbot
import
Chatbot
from
lmdeploy.turbomind.chat
import
valid_str
from
lmdeploy.turbomind.tokenizer
import
Tokenizer
THEME
=
gr
.
themes
.
Soft
(
primary_hue
=
gr
.
themes
.
colors
.
blue
,
...
...
@@ -169,6 +167,7 @@ def chat_stream_local(
nth_round (gr.State): round num
request (gr.Request): the request from a user
"""
from
lmdeploy.turbomind.chat
import
valid_str
session_id
=
threading
.
current_thread
().
ident
if
request
is
not
None
:
session_id
=
int
(
request
.
kwargs
[
'client'
][
'host'
].
replace
(
'.'
,
''
))
...
...
@@ -264,6 +263,7 @@ def run_local(model_path: str,
server_name (str): the ip address of gradio server
server_port (int): the port of gradio server
"""
from
lmdeploy.turbomind.tokenizer
import
Tokenizer
InterFace
.
tokenizer_model_path
=
osp
.
join
(
model_path
,
'triton_models'
,
'tokenizer'
)
InterFace
.
tokenizer
=
Tokenizer
(
InterFace
.
tokenizer_model_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment