mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-15 06:41:34 -08:00
Add login utl to HuggingFace in Web UI
Add some HuggingSpace providers Add icon to home.html Remove duplicate lines from web search results Fix object async_generator can't be used in 'await' Fix for continue message
This commit is contained in:
parent
3784f6edf4
commit
c908dba06e
14 changed files with 206 additions and 45 deletions
|
|
@ -120,7 +120,7 @@ class Backend_Api(Api):
|
|||
tool_calls.append({
|
||||
"function": {
|
||||
"name": "search_tool",
|
||||
"arguments": {"query": web_search, "instructions": ""} if web_search != "true" else {}
|
||||
"arguments": {"query": web_search, "instructions": "", "max_words": 1000} if web_search != "true" else {}
|
||||
},
|
||||
"type": "function"
|
||||
})
|
||||
|
|
@ -173,7 +173,7 @@ class Backend_Api(Api):
|
|||
@app.route('/backend-api/v2/files/<bucket_id>', methods=['GET', 'DELETE'])
|
||||
def manage_files(bucket_id: str):
|
||||
bucket_id = secure_filename(bucket_id)
|
||||
bucket_dir = get_bucket_dir(secure_filename(bucket_id))
|
||||
bucket_dir = get_bucket_dir(bucket_id)
|
||||
|
||||
if not os.path.isdir(bucket_dir):
|
||||
return jsonify({"error": {"message": "Bucket directory not found"}}), 404
|
||||
|
|
@ -231,7 +231,7 @@ class Backend_Api(Api):
|
|||
if not file_data:
|
||||
return jsonify({"error": {"message": "No file data received"}}), 400
|
||||
|
||||
with open(str(file_path), 'wb') as f:
|
||||
with file_path.open('wb') as f:
|
||||
f.write(file_data)
|
||||
|
||||
return jsonify({"message": f"File '{filename}' uploaded successfully to bucket '{bucket_id}'"}), 201
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue