bluenevus commited on
Commit
8007976
·
verified ·
1 Parent(s): 0cc7b41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -16,6 +16,9 @@ def fetch_github_file(github_url, ssh_private_key):
16
  ssh = paramiko.SSHClient()
17
  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
18
 
 
 
 
19
  # Load the private key
20
  private_key = paramiko.RSAKey.from_private_key(io.StringIO(ssh_private_key))
21
 
@@ -94,7 +97,7 @@ iface = gr.Interface(
94
  inputs=[
95
  gr.File(label="Upload dependency file (e.g., requirements.txt, package.json, Gemfile)"),
96
  gr.Textbox(label="GitHub File URL (optional)"),
97
- gr.TextArea(label="SSH Private Key (required if using GitHub URL)", lines=10),
98
  gr.Textbox(label="Gemini API Key", type="password"),
99
  ],
100
  outputs=gr.Textbox(label="License Information and Analysis"),
 
16
  ssh = paramiko.SSHClient()
17
  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
18
 
19
+ # Ensure the SSH key is properly stripped of any leading/trailing whitespace
20
+ ssh_private_key = ssh_private_key.strip()
21
+
22
  # Load the private key
23
  private_key = paramiko.RSAKey.from_private_key(io.StringIO(ssh_private_key))
24
 
 
97
  inputs=[
98
  gr.File(label="Upload dependency file (e.g., requirements.txt, package.json, Gemfile)"),
99
  gr.Textbox(label="GitHub File URL (optional)"),
100
+ gr.TextArea(label="SSH Private Key (required if using GitHub URL)", lines=12),
101
  gr.Textbox(label="Gemini API Key", type="password"),
102
  ],
103
  outputs=gr.Textbox(label="License Information and Analysis"),