mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
[U] Compute hostname differently
Former-commit-id: 6554cdeedb8ab669ce500be404dab8d42a90779b
This commit is contained in:
parent
f5e6e25a1b
commit
0efa34c9ef
@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
import socket
|
||||
import platform
|
||||
|
||||
from ..extras.packages import is_gradio_available
|
||||
from .common import save_config
|
||||
@ -35,8 +35,9 @@ if is_gradio_available():
|
||||
|
||||
def create_ui(demo_mode: bool = False) -> "gr.Blocks":
|
||||
engine = Engine(demo_mode=demo_mode, pure_chat=False)
|
||||
hostname = os.getenv("HOSTNAME", os.getenv("COMPUTERNAME", platform.node())).split('.')[0]
|
||||
|
||||
with gr.Blocks(title=f"LLaMA Board ({socket.gethostname()})", css=CSS) as demo:
|
||||
with gr.Blocks(title=f"LLaMA Board ({hostname})", css=CSS) as demo:
|
||||
if demo_mode:
|
||||
gr.HTML("<h1><center>LLaMA Board: A One-stop Web UI for Getting Started with LLaMA Factory</center></h1>")
|
||||
gr.HTML(
|
||||
|
Loading…
x
Reference in New Issue
Block a user