Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import numpy as np
|
|
| 4 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
| 5 |
import requests
|
| 6 |
import json
|
| 7 |
-
|
| 8 |
# Global initialization
|
| 9 |
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
|
| 10 |
model = GPT2LMHeadModel.from_pretrained('gpt2')
|
|
@@ -49,7 +49,10 @@ def create_interface():
|
|
| 49 |
endpoint = os.environ.get('url') # Ensure this environment variable is correctly set.
|
| 50 |
sl_navigator = SecondLifeNavigator()
|
| 51 |
action_sequence = sl_navigator.run(current_state, endpoint) # Pass the endpoint to the run method.
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
interface = gr.Interface(
|
| 55 |
fn=navigate,
|
|
|
|
| 4 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
| 5 |
import requests
|
| 6 |
import json
|
| 7 |
+
import uuid
|
| 8 |
# Global initialization
|
| 9 |
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
|
| 10 |
model = GPT2LMHeadModel.from_pretrained('gpt2')
|
|
|
|
| 49 |
endpoint = os.environ.get('url') # Ensure this environment variable is correctly set.
|
| 50 |
sl_navigator = SecondLifeNavigator()
|
| 51 |
action_sequence = sl_navigator.run(current_state, endpoint) # Pass the endpoint to the run method.
|
| 52 |
+
# Generate a random UUID and convert it to a string
|
| 53 |
+
random_id = str(uuid.uuid4())
|
| 54 |
+
# Prepend the UUID to the action sequence
|
| 55 |
+
return random_id + ": " + action_sequence
|
| 56 |
|
| 57 |
interface = gr.Interface(
|
| 58 |
fn=navigate,
|