unclemusclez commited on
Commit
330081e
·
verified ·
1 Parent(s): 562f1b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -18,8 +18,7 @@ from textwrap import dedent
18
 
19
  HF_TOKEN = os.environ.get("HF_TOKEN")
20
  OLLAMA_USERNAME = os.environ.get("OLLAMA_USERNAME")
21
- ollama_pubkey = open("/home/ollamafy/.ollama/id_ed25519.pub", "r").read().rstrip()
22
- print(ollama_pubkey)
23
  # ollama_pubkey_read = print(ollama_pubkey.read())
24
 
25
 
@@ -60,9 +59,10 @@ def process_model(model_id, q_method, latest, maintainer, oauth_token: gr.OAuthT
60
 
61
  model_file = model_name + '_modelfile'
62
 
63
- f = open(model_file, "w")
64
  model_path = 'FROM ' + '"' + model_id + '"'
65
- print(f.write(model_path))
 
66
  ollama_conversion = f"ollama create -f {model_file} {OLLAMA_USERNAME}/{ollama_model_name}:{q_method}"
67
 
68
 
@@ -112,7 +112,8 @@ css="""/* Custom CSS to allow scrolling */
112
  # Create Gradio interface
113
  with gr.Blocks(css=css) as demo:
114
  gr.Markdown("You must be logged in to use Ollamafy.")
115
- gr.Markdown(ollama_pubkey)
 
116
  gr.LoginButton(min_width=250)
117
 
118
  model_id = HuggingfaceHubSearch(
@@ -152,7 +153,7 @@ with gr.Blocks(css=css) as demo:
152
  gr.Image(show_label=False),
153
  ],
154
  title="Create your own Ollama Models and Push them to the Ollama Library, blazingly fast ⚡!",
155
- description=ollama_pubkey,
156
  api_name=False
157
  )
158
 
 
18
 
19
  HF_TOKEN = os.environ.get("HF_TOKEN")
20
  OLLAMA_USERNAME = os.environ.get("OLLAMA_USERNAME")
21
+ ollama_pubkey = open("/home/ollamafy/.ollama/id_ed25519.pub", "r")
 
22
  # ollama_pubkey_read = print(ollama_pubkey.read())
23
 
24
 
 
59
 
60
  model_file = model_name + '_modelfile'
61
 
62
+ model_modelfile = open(model_file, "w")
63
  model_path = 'FROM ' + '"' + model_id + '"'
64
+ model_modelfile.write(model_path)
65
+ model_modelfile.close()
66
  ollama_conversion = f"ollama create -f {model_file} {OLLAMA_USERNAME}/{ollama_model_name}:{q_method}"
67
 
68
 
 
112
  # Create Gradio interface
113
  with gr.Blocks(css=css) as demo:
114
  gr.Markdown("You must be logged in to use Ollamafy.")
115
+ gr.Markdown(ollama_pubkey.read().rstrip())
116
+ ollama_pubkey.close()
117
  gr.LoginButton(min_width=250)
118
 
119
  model_id = HuggingfaceHubSearch(
 
153
  gr.Image(show_label=False),
154
  ],
155
  title="Create your own Ollama Models and Push them to the Ollama Library, blazingly fast ⚡!",
156
+ description="Sampled from https://huggingface.co/spaces/ggml-org/gguf-my-repo and https://huggingface.co/spaces/gingdev/ollama-server"
157
  api_name=False
158
  )
159