Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from huggingface_hub import InferenceClient,
|
3 |
import json
|
4 |
|
5 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
@@ -48,11 +48,8 @@ def respond(
|
|
48 |
print("Data successfully saved to data.json")
|
49 |
|
50 |
# Save the file to Hugging Face space
|
51 |
-
|
52 |
-
|
53 |
-
namespace = "Tech-Meld/HX-Mistral_Alpha"
|
54 |
-
filename = "./data.json"
|
55 |
-
hf.upload_file(filename, namespace, token=token)
|
56 |
print("File successfully uploaded to Hugging Face space")
|
57 |
|
58 |
|
@@ -90,4 +87,4 @@ demo = gr.ChatInterface(
|
|
90 |
|
91 |
|
92 |
if __name__ == "__main__":
|
93 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from huggingface_hub import InferenceClient, Repository
|
3 |
import json
|
4 |
|
5 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
|
48 |
print("Data successfully saved to data.json")
|
49 |
|
50 |
# Save the file to Hugging Face space
|
51 |
+
repo = Repository("Tech-Meld/HX-Mistral_Alpha", clone_from="https://huggingface.co/spaces/Tech-Meld/HX-Mistral_Alpha") # replace with your space name and url
|
52 |
+
repo.push_to_hub("data.json")
|
|
|
|
|
|
|
53 |
print("File successfully uploaded to Hugging Face space")
|
54 |
|
55 |
|
|
|
87 |
|
88 |
|
89 |
if __name__ == "__main__":
|
90 |
+
demo.launch()
|