hungryzebra commited on
Commit
f8dc831
·
1 Parent(s): eac488b
Files changed (3) hide show
  1. .gitignore +1 -0
  2. luke-gromen/qa.txt +9 -9
  3. process.py +48 -30
.gitignore CHANGED
@@ -1 +1,2 @@
1
  *.jsonl
 
 
1
  *.jsonl
2
+ output/
luke-gromen/qa.txt CHANGED
@@ -1,16 +1,16 @@
1
- Q: Do you think we are now close to a point where the West's manipulation of gold, among other markets, begins to fail as physical overpowers their leveraged financial tools as it relates to gold specifically? Yes, I do.  If so, do you think prices are more likely to return to equilibrium gradually, or would you expect something similar to what happened in the LME nickel market, where there's a discontinuity, basically a gap up in price? In other words, do you think investors would see it building, or would you just position now and patiently await the inevitable?
2
- A: I think it could go either way. I think the key takeaway is that based on what China has done, what Russia has done, yuan oil, yuan gold based on the flows that we have highlighted in recent weeks, the reversal of flows, gold outperforming real rates, gold outperforming, treasuries in terms of downside, volatility, you're seeing it in markets. A change has happened. Most people want to ignore it or are ignoring it. But what does that mean in terms of how price will adjust? I could make an argument that it could be linear or nonlinear. In my opinion, it's more likely to be **nonlinear** for multiple reasons.  I think it'll be tough to chase, even if it is linear. So I would just rather be there with a good sized position in physical bullion ahead of time and not try to get too cute. I think it's really important to remember the context of what we're in, which is a series of factors that are unprecedented. 1. Global bursting, sovereign debt bubble. 2. Ending of a 50 year currency system. 3. Rising of another competitive power. 4. The incumbent trying to defend their turf peak. 5. Cheap oil (which has never happened in the way in which it has, trying to transition to a new, less efficient energy system). It's complicated. And when it's complicated, I like to operate with low levels of leverage and large margins of error.
3
- Q: A lot of US gold and gold mining investors have been suffering the last ten years.  Everyone has seemingly been getting rich, while US. Gold investors are waiting for that imminent price explosion that doesn't ever seem to get here. What are your thoughts about timing, conviction on the price of gold and miners one, three and five years out? Will we finally get paid for all this patience?
4
- A: Yes, I think we're all going to get paid for patience, particularly as it relates to gold bullion and certain miners.  I don't know about all of them broadly, but certain miners. And the question, of course, is when. Again, it's a function of rates. It's a function of energy. Interest never sleeps, and depletion rates on energy don't sleep either. And both of those things are very supportive of goals. Secularly. When can it happen? I think it will reprice. I think it will reprice in a relatively compressed way. And when it does, I think a lot of people are either going to be there or they aren't. And I think once that repricing happens, I think people will be very they'll feel very good for being there ahead of time and it'll have made the waiting worthwhile. But I agree it has been frustrating at time. I will say the way Gold has performed with real rates, doing what they're doing over the last 18 months has been extremely encouraging.
5
- Q: You talk about the recapitalization of gold as a potential outcome of US. Fiscal turmoil.  Can you provide a rough back of the envelope math to the three revaluation scenarios?
6
  A: One, gold revalued to shore up a dollar balance sheet. Two, gold revalued to equal value of dollar priced commodity flows. And three, if gold were reweighted in wealth management portfolios from negligible percent to adequate percentage. Gold revalued to shore up the US. Dollar balance sheet. There'd be a 3x to 20x increase in the value of gold, that is market value of official US. Gold. As a percent of foreign held treasuries, it's 7% now. It was never below 20% prior to 89. It got as high as 135% in 1980. So: 3x 7% to 20%; 20x 7% to 135%. Gold revalued to equal value in dollar price commodity flows. I just look at oil, it's the biggest commodity, it's the easiest math. Oil is about the oil market. In current annual production, dollar flows is about 15x to 18x the gold market. Gold were reweighted in wealth management portfolios. you're probably looking at a 5x to 10x percentage increase. Most portfolios, it's actually infinite because most portfolios own zero, but let's assume they own one. You probably need to be at least at five to 10% as our correct allocation. And so assuming the average weighting is one, which it probably isn't, it's at least 5-10x. Let's see.
7
  Q: How do you see inflation impacting housing prices? Is it supportive, unsupportive, or both? Feels like prices have to come down due to affordability, yet they are also an inflation hedge. Any thoughts?
8
- A: I think it's going to be like some other asset classes where it's probably negative for a bit and then positive. It depends on what happens with real rates.  And ultimately real rates have to get very negative. But if they get really positive for a second first, in other words, if asset prices crash, if bond yields spike, that could be really bad for them at first. It increasingly looks like that is what's going to happen. It also depends on how quickly the regulatory response would be. So does the Fed go right to yield curve control? Do they let markets twist in the wind for a bit? And with real estate and housing, of course, all markets are it's a local phenomenon. So there are elements where higher end places may not see a slowdown, whether that be due to supply demand, some of that because people with low mortgages don't want to leave. Some of that because of demand. From the standpoint of higher rates, high levels of retiree money, they're making a lot more every month. So there's actually a stimulus dynamic to people with large bond portfolios in terms of the income component, in theory. So net net best guess, I think home prices go down first and then they probably go up pretty notably after that.
9
- Q: I understand the issues with fiscal dominance. I understand the issues surrounding the relative international investment positions of countries like Japan and Germany.  I also can see your logic regarding the BRICS countries settling trade differentials in gold. However, in the words of Edward Murrow, anyone who isn't confused really doesn't understand the situation. That's a great way of phrasing it.Would you please lay out how you see the progression of events piece by piece, so those of us who are looking for signs can understand what to look for moving forward?
10
- A: Given the framework and the context that you laid out that we've talked about a lot, I think the big gears for the next several months in particular, are the dollar and oil. If they don't get the dollar and oil down a lot soon, I think you're going to get into a very vicious cycle of dollar up rates up, risk off, dollar up rates up risk off, until you either get a crash or you get the Fed stepping in. And when I say crash, I mean a crash in stocks, a crash in Treasuries, a crash in basically everything. I think gold outperforms, I think oil probably outperforms as well, but they probably both still go down. Everything but the dollar goes down. In that case, if you can get them down, the dollar and oil, you can get risk on, you can get rates down, you can get a rally in a lot of different things, including the global economy, in emerging markets and what have you. The geopolitics, I think, are another big gear worth watching. When you have the UK launching UK missile, the UK giving UK missiles to the Ukrainians to attack Russian naval bases in Sevistopol, you have to think the Russians are going to respond. And three days ago, we get the Russians banning diesel exports.  15% of global seaborne diesel exports. You'll get the weaponization of energy. Take that back to the beginning, right? Dollar and oil.
11
  Q: Something is breaking, we just don't know when. As Dan Oliver pointed out about the wave crashing, I wonder, is this the crest that breaks the bank? My question is, why can't we hide with part of our currency in Swiss francs?
12
  A: I don't save in the Swiss francs just because here in the US. I'd rather be gold and Bitcoin. They're more volatile. I understand that, but I wouldn't disagree in terms of if you want to hold a foreign currency, I think Swiss franc. If it's not dollars, I think Swiss franc is probably your next best alternative in terms of both strength and relative stability. Is this the crest that breaks the bank? I think breaks the bank needs to be defined. Do I think what we're seeing in treasury markets is enough to create a severe risk off and force the Fed back into QE or dollar liquidity injections or treasury with the same with oil above 90 and gold above $1,900? Yes, I do. Absolutely I do.
13
- Q: You've repeatedly stated your overweight gold and gold miners.  Are all of your gold in physical custody? What about Gold ETFs? Any potential problems?
14
  A: I own gold in physical format, gold bullion. That is my primary exposure. It is custody at a non bank custodian in the region. In terms of there are vaulting services in various big cities where you can store that are not affiliated with a bank. If you look those up, you can find out about those. That's where I have mine stored, at a vault there. That is where my primary exposure is. Problems with specific ETFs. For me, I just think it's important to understand that if you're going to own gold, you should own gold. GLD is a great trading vehicle. There's nothing wrong with it. If I owned gold or I wanted to own gold for the reasons that I want to own gold and that I encourage people to own gold, I don't think GLD is an optimal vehicle. I would much rather own the physical bullion. Let's see.
15
  Q: If you had the opportunity to hold mutual funds of oil or gold equities hedged in Swiss francs, would you choose to do so? If not, why?
16
  A: For me, it's a personal choice, understanding that what we're seeing should squeeze the dollar higher, number one, even as everything else kind of comes unhinged. But then, number two, I live in the US, spend in the US. So for me it's dollars. If I lived in Switzerland, I probably would store a good portion or in Europe for that matter, I probably would store a good portion of my currency holdings in Swiss franc. So that's how I've thought about it historically.
 
1
+ Q: Do you think we are now close to a point where the West's manipulation of gold, among other markets, begins to fail as physical overpowers their leveraged financial tools as it relates to gold specifically? Yes, I do. If so, do you think prices are more likely to return to equilibrium gradually, or would you expect something similar to what happened in the LME nickel market, where there's a discontinuity, basically a gap up in price? In other words, do you think investors would see it building, or would you just position now and patiently await the inevitable?
2
+ A: I think it could go either way. I think the key takeaway is that based on what China has done, what Russia has done, yuan oil, yuan gold based on the flows that we have highlighted in recent weeks, the reversal of flows, gold outperforming real rates, gold outperforming, treasuries in terms of downside, volatility, you're seeing it in markets. A change has happened. Most people want to ignore it or are ignoring it. But what does that mean in terms of how price will adjust? I could make an argument that it could be linear or nonlinear. In my opinion, it's more likely to be **nonlinear** for multiple reasons. I think it'll be tough to chase, even if it is linear. So I would just rather be there with a good sized position in physical bullion ahead of time and not try to get too cute. I think it's really important to remember the context of what we're in, which is a series of factors that are unprecedented. 1. Global bursting, sovereign debt bubble. 2. Ending of a 50 year currency system. 3. Rising of another competitive power. 4. The incumbent trying to defend their turf peak. 5. Cheap oil (which has never happened in the way in which it has, trying to transition to a new, less efficient energy system). It's complicated. And when it's complicated, I like to operate with low levels of leverage and large margins of error.
3
+ Q: A lot of US gold and gold mining investors have been suffering the last ten years. Everyone has seemingly been getting rich, while US. Gold investors are waiting for that imminent price explosion that doesn't ever seem to get here. What are your thoughts about timing, conviction on the price of gold and miners one, three and five years out? Will we finally get paid for all this patience?
4
+ A: Yes, I think we're all going to get paid for patience, particularly as it relates to gold bullion and certain miners. I don't know about all of them broadly, but certain miners. And the question, of course, is when. Again, it's a function of rates. It's a function of energy. Interest never sleeps, and depletion rates on energy don't sleep either. And both of those things are very supportive of goals. Secularly. When can it happen? I think it will reprice. I think it will reprice in a relatively compressed way. And when it does, I think a lot of people are either going to be there or they aren't. And I think once that repricing happens, I think people will be very they'll feel very good for being there ahead of time and it'll have made the waiting worthwhile. But I agree it has been frustrating at time. I will say the way Gold has performed with real rates, doing what they're doing over the last 18 months has been extremely encouraging.
5
+ Q: You talk about the recapitalization of gold as a potential outcome of US. Fiscal turmoil. Can you provide a rough back of the envelope math to the three revaluation scenarios?
6
  A: One, gold revalued to shore up a dollar balance sheet. Two, gold revalued to equal value of dollar priced commodity flows. And three, if gold were reweighted in wealth management portfolios from negligible percent to adequate percentage. Gold revalued to shore up the US. Dollar balance sheet. There'd be a 3x to 20x increase in the value of gold, that is market value of official US. Gold. As a percent of foreign held treasuries, it's 7% now. It was never below 20% prior to 89. It got as high as 135% in 1980. So: 3x 7% to 20%; 20x 7% to 135%. Gold revalued to equal value in dollar price commodity flows. I just look at oil, it's the biggest commodity, it's the easiest math. Oil is about the oil market. In current annual production, dollar flows is about 15x to 18x the gold market. Gold were reweighted in wealth management portfolios. you're probably looking at a 5x to 10x percentage increase. Most portfolios, it's actually infinite because most portfolios own zero, but let's assume they own one. You probably need to be at least at five to 10% as our correct allocation. And so assuming the average weighting is one, which it probably isn't, it's at least 5-10x. Let's see.
7
  Q: How do you see inflation impacting housing prices? Is it supportive, unsupportive, or both? Feels like prices have to come down due to affordability, yet they are also an inflation hedge. Any thoughts?
8
+ A: I think it's going to be like some other asset classes where it's probably negative for a bit and then positive. It depends on what happens with real rates. And ultimately real rates have to get very negative. But if they get really positive for a second first, in other words, if asset prices crash, if bond yields spike, that could be really bad for them at first. It increasingly looks like that is what's going to happen. It also depends on how quickly the regulatory response would be. So does the Fed go right to yield curve control? Do they let markets twist in the wind for a bit? And with real estate and housing, of course, all markets are it's a local phenomenon. So there are elements where higher end places may not see a slowdown, whether that be due to supply demand, some of that because people with low mortgages don't want to leave. Some of that because of demand. From the standpoint of higher rates, high levels of retiree money, they're making a lot more every month. So there's actually a stimulus dynamic to people with large bond portfolios in terms of the income component, in theory. So net net best guess, I think home prices go down first and then they probably go up pretty notably after that.
9
+ Q: I understand the issues with fiscal dominance. I understand the issues surrounding the relative international investment positions of countries like Japan and Germany. I also can see your logic regarding the BRICS countries settling trade differentials in gold. However, in the words of Edward Murrow, anyone who isn't confused really doesn't understand the situation. That's a great way of phrasing it.Would you please lay out how you see the progression of events piece by piece, so those of us who are looking for signs can understand what to look for moving forward?
10
+ A: Given the framework and the context that you laid out that we've talked about a lot, I think the big gears for the next several months in particular, are the dollar and oil. If they don't get the dollar and oil down a lot soon, I think you're going to get into a very vicious cycle of dollar up rates up, risk off, dollar up rates up risk off, until you either get a crash or you get the Fed stepping in. And when I say crash, I mean a crash in stocks, a crash in Treasuries, a crash in basically everything. I think gold outperforms, I think oil probably outperforms as well, but they probably both still go down. Everything but the dollar goes down. In that case, if you can get them down, the dollar and oil, you can get risk on, you can get rates down, you can get a rally in a lot of different things, including the global economy, in emerging markets and what have you. The geopolitics, I think, are another big gear worth watching. When you have the UK launching UK missile, the UK giving UK missiles to the Ukrainians to attack Russian naval bases in Sevistopol, you have to think the Russians are going to respond. And three days ago, we get the Russians banning diesel exports. 15% of global seaborne diesel exports. You'll get the weaponization of energy. Take that back to the beginning, right? Dollar and oil.
11
  Q: Something is breaking, we just don't know when. As Dan Oliver pointed out about the wave crashing, I wonder, is this the crest that breaks the bank? My question is, why can't we hide with part of our currency in Swiss francs?
12
  A: I don't save in the Swiss francs just because here in the US. I'd rather be gold and Bitcoin. They're more volatile. I understand that, but I wouldn't disagree in terms of if you want to hold a foreign currency, I think Swiss franc. If it's not dollars, I think Swiss franc is probably your next best alternative in terms of both strength and relative stability. Is this the crest that breaks the bank? I think breaks the bank needs to be defined. Do I think what we're seeing in treasury markets is enough to create a severe risk off and force the Fed back into QE or dollar liquidity injections or treasury with the same with oil above 90 and gold above $1,900? Yes, I do. Absolutely I do.
13
+ Q: You've repeatedly stated your overweight gold and gold miners. Are all of your gold in physical custody? What about Gold ETFs? Any potential problems?
14
  A: I own gold in physical format, gold bullion. That is my primary exposure. It is custody at a non bank custodian in the region. In terms of there are vaulting services in various big cities where you can store that are not affiliated with a bank. If you look those up, you can find out about those. That's where I have mine stored, at a vault there. That is where my primary exposure is. Problems with specific ETFs. For me, I just think it's important to understand that if you're going to own gold, you should own gold. GLD is a great trading vehicle. There's nothing wrong with it. If I owned gold or I wanted to own gold for the reasons that I want to own gold and that I encourage people to own gold, I don't think GLD is an optimal vehicle. I would much rather own the physical bullion. Let's see.
15
  Q: If you had the opportunity to hold mutual funds of oil or gold equities hedged in Swiss francs, would you choose to do so? If not, why?
16
  A: For me, it's a personal choice, understanding that what we're seeing should squeeze the dollar higher, number one, even as everything else kind of comes unhinged. But then, number two, I live in the US, spend in the US. So for me it's dollars. If I lived in Switzerland, I probably would store a good portion or in Europe for that matter, I probably would store a good portion of my currency holdings in Swiss franc. So that's how I've thought about it historically.
process.py CHANGED
@@ -1,31 +1,13 @@
1
  import argparse
 
 
 
 
2
  import os
3
  import json
4
 
5
- def verify_file(file_path):
6
- """
7
- Verify if the lines in a file have the correct prefix.
8
-
9
- Args:
10
- file_path (str): The path to the file to be verified.
11
-
12
- Returns:
13
- bool: True if all lines have the correct prefix, False otherwise.
14
- """
15
-
16
- with open(file_path, 'r', encoding='utf-8') as file:
17
- lines = file.readlines()
18
-
19
- for i, line in enumerate(lines):
20
- if i % 2 == 0:
21
- if not line.startswith('Q:'):
22
- return False
23
- else:
24
- if not line.startswith('A:'):
25
- return False
26
-
27
- return True
28
 
 
29
 
30
  def generate_jsonlines(directory, output_filename):
31
  """
@@ -42,11 +24,14 @@ def generate_jsonlines(directory, output_filename):
42
  """
43
 
44
  if not os.path.exists(os.path.join(directory, 'intro.txt')) or not os.path.exists(os.path.join(directory, 'qa.txt')):
45
- raise FileNotFoundError('intro.txt or qa.txt not found in the given directory')
 
46
 
47
  if not verify_file(os.path.join(directory, 'qa.txt')):
48
  raise ValueError('qa.txt is not in the correct format')
49
 
 
 
50
  with open(os.path.join(directory, 'intro.txt'), 'r', encoding='utf-8') as intro_file:
51
  intro_content = intro_file.read().strip()
52
 
@@ -66,21 +51,54 @@ def generate_jsonlines(directory, output_filename):
66
  {'role': 'assistant', 'content': line[2:].strip()}
67
  ])
68
 
69
- with open(os.path.join(directory, output_filename), 'w', encoding='utf-8') as jsonl_file:
70
  for message in messages:
71
  jsonl_file.write(json.dumps({'messages': message}) + '\n')
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
 
74
 
75
  def main():
76
 
77
- parser = argparse.ArgumentParser(description='Generate a jsonlines file from intro.txt and qa.txt in a given directory.')
78
- parser.add_argument('directory', type=str, help='The directory where intro.txt and qa.txt are located.')
79
- parser.add_argument('output_filename', type=str, help='The name of the output jsonlines file.')
 
 
 
 
 
 
 
 
 
 
80
 
81
- args = parser.parse_args()
82
 
83
- generate_jsonlines(args.directory, args.output_filename)
84
 
85
  if __name__ == '__main__':
 
86
  main()
 
1
  import argparse
2
+ import logging
3
+ import os
4
+ import json
5
+ import os
6
  import os
7
  import json
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
+ OUTPUT_DIR = os.path.join('.', 'output')
11
 
12
  def generate_jsonlines(directory, output_filename):
13
  """
 
24
  """
25
 
26
  if not os.path.exists(os.path.join(directory, 'intro.txt')) or not os.path.exists(os.path.join(directory, 'qa.txt')):
27
+ logging.info("Ignoring %s", directory)
28
+ return
29
 
30
  if not verify_file(os.path.join(directory, 'qa.txt')):
31
  raise ValueError('qa.txt is not in the correct format')
32
 
33
+ logging.info("Processing %s", directory)
34
+
35
  with open(os.path.join(directory, 'intro.txt'), 'r', encoding='utf-8') as intro_file:
36
  intro_content = intro_file.read().strip()
37
 
 
51
  {'role': 'assistant', 'content': line[2:].strip()}
52
  ])
53
 
54
+ with open(output_filename, 'w', encoding='ascii') as jsonl_file:
55
  for message in messages:
56
  jsonl_file.write(json.dumps({'messages': message}) + '\n')
57
 
58
+ def verify_file(file_path):
59
+ """
60
+ Verify if the lines in a file have the correct prefix.
61
+
62
+ Args:
63
+ file_path (str): The path to the file to be verified.
64
+
65
+ Returns:
66
+ bool: True if all lines have the correct prefix, False otherwise.
67
+ """
68
+
69
+ with open(file_path, 'r', encoding='utf-8') as file:
70
+ lines = file.readlines()
71
+
72
+ for i, line in enumerate(lines):
73
+ if i % 2 == 0:
74
+ if not line.startswith('Q:'):
75
+ return False
76
+ else:
77
+ if not line.startswith('A:'):
78
+ return False
79
 
80
+ return True
81
 
82
  def main():
83
 
84
+ os.makedirs(OUTPUT_DIR, exist_ok=True)
85
+
86
+ for directory_name in os.listdir('.'):
87
+ directory_path = os.path.join('.', directory_name)
88
+ if os.path.isdir(directory_path) and directory_path != OUTPUT_DIR:
89
+ if os.path.isdir(directory_path):
90
+ output_filename = f"{directory_name}.txt"
91
+ generate_jsonlines(directory_path, os.path.join(OUTPUT_DIR, output_filename))
92
+
93
+
94
+ # parser = argparse.ArgumentParser(description='Generate a jsonlines file from intro.txt and qa.txt in a given directory.')
95
+ # parser.add_argument('directory', type=str, help='The directory where intro.txt and qa.txt are located.')
96
+ # parser.add_argument('output_filename', type=str, help='The name of the output jsonlines file.')
97
 
98
+ # args = parser.parse_args()
99
 
100
+ # generate_jsonlines(args.directory, args.output_filename)
101
 
102
  if __name__ == '__main__':
103
+ logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
104
  main()