Skip to content

Commit

Permalink
torch 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alewin committed Apr 6, 2023
1 parent fe0958b commit d0eeb13
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ async fn init_webui(webuipath: String, window: Window) -> Result<String, String>
window.emit("stdout", Payload {message: output_str}).unwrap();
}

// pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
// pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
// update the pip source config
let pip_config = format!("{}\\venv\\Scripts\\pip.exe", webuipath.clone());
let pip_config_output = Command::new(pip_config)
.arg("config")
.arg("set")
.arg("global.index-url")
.arg("https://pypi.tuna.tsinghua.edu.cn/simple")
.arg("http://mirrors.cloud.tencent.com/pypi/simple")
.output()
.expect("failed to execute pip config command");
let pip_config_output = String::from_utf8(pip_config_output.stdout)
Expand All @@ -152,8 +152,8 @@ async fn init_webui(webuipath: String, window: Window) -> Result<String, String>
let torch_whl_dir = format!("{}\\torch_whl", webuipath.clone());
let torch_whl_file = "torch-1.13.1+cu117-cp310-cp310-win_amd64.whl".to_string();
let torchvision_whl_file = "torchvision-0.14.2+cu117-cp310-cp310-win_amd64.whl".to_string();
let torch_whl_download_url = "https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-win_amd64.whl".to_string();
let torchvision_whl_download_url = "https://download.pytorch.org/whl/cu117/torchvision-0.14.2%2Bcu117-cp310-cp310-win_amd64.whl".to_string();
let torch_whl_download_url = "https://download.pytorch.org/whl/cu117/torch-2.0.0%2Bcu117-cp310-cp310-win_amd64.whl".to_string();
let torchvision_whl_download_url = "https://download.pytorch.org/whl/cu117/torchvision-0.15.1%2Bcu117-cp310-cp310-win_amd64.whl".to_string();

//check if torch is installed
let torch_installed = funcs::check_if_python_package_installed(webuipath.clone(),"torch".to_string()).await;
Expand Down
26 changes: 22 additions & 4 deletions src/containers/StartView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,29 @@ export const StartView: React.FC<StartViewProps> = ({
<div className="stat-title">System Info</div>
<div className="stat-value">{store.systemInfo.archName}</div>
<div className="stat-desc">{store.systemInfo.platformName}</div>
{store.systemInfo.archName === "x86_64" ? (
<button className="btn btn-sm btn-success">Good</button>
) : (
<button className="btn btn-sm btn-error">Not enough</button>
)}
</div>
<div className="stat">
<div className="stat-title">GPU Memory</div>
<div className="stat-value">{store.systemInfo.gpuMemory}GB</div>
<div className="stat-desc">{store.systemInfo.gpuName}</div>
{store.systemInfo.gpuMemory >= 8 ? (
<button className="btn btn-sm btn-success">Good</button>
) : (
<button className="btn btn-sm btn-error">Not enough</button>
)}
</div>
<div className="stat">
<div className="stat-title">CUDA Version</div>
<div className="stat-value">{store.systemInfo.cudaVersion}</div>
{store.systemInfo.cudaVersion && store.systemInfo.cudaVersion < 11 && (
<div className="stat-desc">--</div>
{store.systemInfo.cudaVersion && store.systemInfo.cudaVersion >= 11 ? (
<button className="btn btn-sm btn-success">Good</button>
) : (
<div className="stat-actions">
<button className="btn btn-sm btn-error">Get the cudatoolkit</button>
</div>
Expand All @@ -78,8 +91,10 @@ export const StartView: React.FC<StartViewProps> = ({
<div className="stat">
<div className="stat-title">Python Version</div>
<div className="stat-value">{store.python_version}</div>
<div className="stat-desc">{store.settings.python_path}</div>
{satisfies(store.python_version || "0.0.0", "^3.10.0") || (
<div className="stat-desc">{store.settings.python_path || "--"}</div>
{satisfies(store.python_version || "0.0.0", "^3.10.0") ? (
<button className="btn btn-sm btn-success">Good</button>
) : (
<div className="stat-actions">
<button className="btn btn-sm btn-error" onClick={getPythonLocation}>
Locate python
Expand All @@ -93,7 +108,10 @@ export const StartView: React.FC<StartViewProps> = ({
<div className="stat">
<div className="stat-title">Git Version</div>
<div className="stat-value">{store.git_version}</div>
{Boolean(store.git_version) || (
<div className="stat-desc">--</div>
{store.git_version ? (
<button className="btn btn-sm btn-success">Good</button>
) : (
<div className="stat-actions">
<button className="btn btn-sm btn-error" onClick={goToGitDownload}>
Get the git
Expand Down

0 comments on commit d0eeb13

Please sign in to comment.